Module Name: src Committed By: christos Date: Thu Jul 21 18:21:27 UTC 2016
Modified Files: src/sys/fs/puffs: puffs_vnops.c Log Message: replace variable stack declaration with a large enough one and KASSERT. To generate a diff of this commit: cvs rdiff -u -r1.204 -r1.205 src/sys/fs/puffs/puffs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/fs/puffs/puffs_vnops.c diff -u src/sys/fs/puffs/puffs_vnops.c:1.204 src/sys/fs/puffs/puffs_vnops.c:1.205 --- src/sys/fs/puffs/puffs_vnops.c:1.204 Thu Jul 7 02:55:42 2016 +++ src/sys/fs/puffs/puffs_vnops.c Thu Jul 21 14:21:27 2016 @@ -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 return; len = round_page(off) - off; + KASSERT(len < sizeof(zbuf)); memset(zbuf, 0, len); iov.iov_base = zbuf;