Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ext2fs memset ump->um_e2fs to 0 after malloc, it is ...



details:   https://anonhg.NetBSD.org/src/rev/65f34505487d
branches:  trunk
changeset: 473397:65f34505487d
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Tue Jun 01 13:18:49 1999 +0000

description:
memset ump->um_e2fs to 0 after malloc, it is bigger than SBSIZE and thus some
parts were left uninitialised. The symptom was that a read-only mount tried
to rewrite back the superblock.

diffstat:

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

diffs (17 lines):

diff -r d64ff48d5307 -r 65f34505487d sys/ufs/ext2fs/ext2fs_vfsops.c
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c    Tue Jun 01 09:34:06 1999 +0000
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c    Tue Jun 01 13:18:49 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_vfsops.c,v 1.24 1999/02/26 23:44:49 wrstuden Exp $      */
+/*     $NetBSD: ext2fs_vfsops.c,v 1.25 1999/06/01 13:18:49 bouyer Exp $        */
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.
@@ -545,6 +545,7 @@
        ump = malloc(sizeof *ump, M_UFSMNT, M_WAITOK);
        memset((caddr_t)ump, 0, sizeof *ump);
        ump->um_e2fs = malloc(sizeof(struct m_ext2fs), M_UFSMNT, M_WAITOK);
+       memset((caddr_t)ump->um_e2fs, 0, sizeof(struct m_ext2fs));
        e2fs_sbload((struct ext2fs*)bp->b_data, &ump->um_e2fs->e2fs);
        brelse(bp);
        bp = NULL;



Home | Main Index | Thread Index | Old Index