diff options
author | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 1998-08-17 19:30:31 +0000 |
---|---|---|
committer | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 1998-08-17 19:30:31 +0000 |
commit | 0f2aad1430b0cde6fcc4d0ecdb332b64a3ffee33 (patch) | |
tree | d4eee43681546b7cfde27d32290fe8bb445fe360 | |
parent | 2512e19de9393cf8cd0589e7ead4b5129288a49c (diff) |
Fix for FFS leaking buffer cache data on segfaults during write.
Thanks to Chuck Silvers (chuq@chuq.com)
-rw-r--r-- | sys/ufs/ufs/ufs_readwrite.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c index 4cecf167d60..4d64776094b 100644 --- a/sys/ufs/ufs/ufs_readwrite.c +++ b/sys/ufs/ufs/ufs_readwrite.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_readwrite.c,v 1.13 1998/03/01 08:07:13 niklas Exp $ */ +/* $OpenBSD: ufs_readwrite.c,v 1.14 1998/08/17 19:30:30 csapuntz Exp $ */ /* $NetBSD: ufs_readwrite.c,v 1.9 1996/05/11 18:27:57 mycroft Exp $ */ /*- @@ -261,7 +261,11 @@ WRITE(v) xfersize = size; error = - uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio); + uiomove((char *)bp->b_data + blkoffset, xfersize, uio); + + if (error != 0) + bzero((char *)bp->b_data + blkoffset, xfersize); + #ifdef LFS_READWRITE (void)VOP_BWRITE(bp); #else |