summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorniklas <niklas@openbsd.org>1998-01-21 12:23:45 +0000
committerniklas <niklas@openbsd.org>1998-01-21 12:23:45 +0000
commit4a74e7cf8a8da23ffd0fcd9af7e7b1347bce2b73 (patch)
treea851db08e392ccf9e0c431ce0ae8434aa499d47d
parentremove obsolete comment (diff)
downloadwireguard-openbsd-4a74e7cf8a8da23ffd0fcd9af7e7b1347bce2b73.tar.xz
wireguard-openbsd-4a74e7cf8a8da23ffd0fcd9af7e7b1347bce2b73.zip
Prevent a NULL-deref in the autoconf_verbose case
-rw-r--r--sys/kern/subr_autoconf.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c
index fa8751e8eee..13c6e0f6fcc 100644
--- a/sys/kern/subr_autoconf.c
+++ b/sys/kern/subr_autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_autoconf.c,v 1.18 1998/01/20 20:12:11 niklas Exp $ */
+/* $OpenBSD: subr_autoconf.c,v 1.19 1998/01/21 12:23:45 niklas Exp $ */
/* $NetBSD: subr_autoconf.c,v 1.21 1996/04/04 06:06:18 cgd Exp $ */
/*
@@ -201,9 +201,12 @@ config_search(fn, parent, aux)
}
}
if (autoconf_verbose)
- printf(">>> probe for %s%d won\n",
- ((struct cfdata *)m.match)->cf_driver->cd_name,
- ((struct cfdata *)m.match)->cf_unit);
+ if (m.match)
+ printf(">>> probe for %s%d won\n",
+ ((struct cfdata *)m.match)->cf_driver->cd_name,
+ ((struct cfdata *)m.match)->cf_unit);
+ else
+ printf(">>> no winning probe\n");
return (m.match);
}