summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2021-01-09 19:30:14 +0000
committermartin <martin@NetBSD.org>2021-01-09 19:30:14 +0000
commit76d3f61f21ef6e2dfbf3fd953c173a032bc8a18c (patch)
tree4d8a00f1222ce85f4fce4b039dded4846d8a4e4f /sbin
parenta64151e58fceec2570903fa6fa5b056c5a4b1acc (diff)
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.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/fsck/partutil.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/fsck/partutil.c b/sbin/fsck/partutil.c
index 327eff6e632..50c262038b0 100644
--- a/sbin/fsck/partutil.c
+++ b/sbin/fsck/partutil.c
@@ -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 char *dt, struct disk_geom *geo,
}
/* 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 */