Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/lib/libsa Zero the in-memory super block after allocatio...



details:   https://anonhg.NetBSD.org/src/rev/12acb956dff8
branches:  trunk
changeset: 760333:12acb956dff8
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sun Jan 02 21:37:01 2011 +0000

description:
Zero the in-memory super block after allocation.  It contains a pointer
that, if not properly initialized, could be improperly deallocated.

diffstat:

 sys/lib/libsa/ext2fs.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r e6aaca57c936 -r 12acb956dff8 sys/lib/libsa/ext2fs.c
--- a/sys/lib/libsa/ext2fs.c    Sun Jan 02 21:34:00 2011 +0000
+++ b/sys/lib/libsa/ext2fs.c    Sun Jan 02 21:37:01 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs.c,v 1.8 2009/10/19 18:41:16 bouyer Exp $        */
+/*     $NetBSD: ext2fs.c,v 1.9 2011/01/02 21:37:01 jakllsch Exp $      */
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.
@@ -510,6 +510,7 @@
 
        /* allocate space and read super block */
        fs = alloc(sizeof(*fs));
+       memset(fs, 0, sizeof(*fs));
        fp->f_fs = fs;
        twiddle();
 



Home | Main Index | Thread Index | Old Index