Module Name:    src
Committed By:   bad
Date:           Sat Sep 28 18:03:19 UTC 2019

Modified Files:
        src/sbin/fsck: partutil.c

Log Message:
initialize disc_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.16 -r1.17 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.16 src/sbin/fsck/partutil.c:1.17
--- src/sbin/fsck/partutil.c:1.16	Sun Aug 18 11:08:56 2019
+++ src/sbin/fsck/partutil.c	Sat Sep 28 18:03:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partutil.c,v 1.16 2019/08/18 11:08:56 martin Exp $	*/
+/*	$NetBSD: partutil.c,v 1.17 2019/09/28 18:03:18 bad Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: partutil.c,v 1.16 2019/08/18 11:08:56 martin Exp $");
+__RCSID("$NetBSD: partutil.c,v 1.17 2019/09/28 18:03:18 bad 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