Module Name:    src
Committed By:   martin
Date:           Sat Jan  9 19:30:14 UTC 2021

Modified Files:
        src/sbin/fsck [netbsd-9]: partutil.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1184):

        sbin/fsck/partutil.c: revision 1.17

initialize disk_dict to NULL.

otherwise, if DIOCGDISKINFO returns an error != ENXIO getdiskinfo() later
tries to prop_object_release() stack garbage.

found by rumpctrl tests using clang-7.


To generate a diff of this commit:
cvs rdiff -u -r1.15.18.1 -r1.15.18.2 src/sbin/fsck/partutil.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/fsck/partutil.c
diff -u src/sbin/fsck/partutil.c:1.15.18.1 src/sbin/fsck/partutil.c:1.15.18.2
--- src/sbin/fsck/partutil.c:1.15.18.1	Sun Aug 18 13:31:21 2019
+++ src/sbin/fsck/partutil.c	Sat Jan  9 19:30:14 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: partutil.c,v 1.15.18.1 2019/08/18 13:31:21 msaitoh Exp $	*/
+/*	$NetBSD: partutil.c,v 1.15.18.2 2021/01/09 19:30:14 martin Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: partutil.c,v 1.15.18.1 2019/08/18 13:31:21 msaitoh Exp $");
+__RCSID("$NetBSD: partutil.c,v 1.15.18.2 2021/01/09 19:30:14 martin Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -108,6 +108,7 @@ getdiskinfo(const char *s, int fd, const
 	}
 
 	/* Get disk description dictionary */
+	disk_dict = NULL;
 	error = prop_dictionary_recv_ioctl(fd, DIOCGDISKINFO, &disk_dict);
 
 	/* fail quickly if the device does not exist at all */

Reply via email to