replace variable stack declaration with a large enough one and KASSERT.

This commit is contained in:
christos 2016-07-21 18:21:27 +00:00
parent 90668226c4
commit 0d5ace558d
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs_vnops.c,v 1.204 2016/07/07 06:55:42 msaitoh Exp $ */
/* $NetBSD: puffs_vnops.c,v 1.205 2016/07/21 18:21:27 christos Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.204 2016/07/07 06:55:42 msaitoh Exp $");
__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.205 2016/07/21 18:21:27 christos Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -1147,7 +1147,7 @@ puffs_vnop_getattr(void *v)
static void
zerofill_lastpage(struct vnode *vp, voff_t off)
{
char zbuf[PAGE_SIZE];
char zbuf[16384];
struct iovec iov;
struct uio uio;
vsize_t len;
@ -1160,6 +1160,7 @@ zerofill_lastpage(struct vnode *vp, voff_t off)
return;
len = round_page(off) - off;
KASSERT(len < sizeof(zbuf));
memset(zbuf, 0, len);
iov.iov_base = zbuf;