aboutsummaryrefslogtreecommitdiff
path: root/sbin/mdconfig
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2017-02-19 16:08:58 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2017-02-19 16:08:58 +0000
commit30545786bb310c0a754b406402d8a07de1fb7fae (patch)
tree62878a62220d0908e2c02cd465789dc4b1026797 /sbin/mdconfig
parent316e092a77c448b7873ba934411f5c29b4ed3fab (diff)
downloadsrc-30545786bb310c0a754b406402d8a07de1fb7fae.tar.gz
src-30545786bb310c0a754b406402d8a07de1fb7fae.zip
Make mdconfig(8) not segfault when the kernel returns garbage data.
MFC after: 2 weeks Sponsored by: DARPA, AFRL
Notes
Notes: svn path=/head/; revision=313943
Diffstat (limited to 'sbin/mdconfig')
-rw-r--r--sbin/mdconfig/mdconfig.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c
index e86ffdc4e961..f1c013c8b9fe 100644
--- a/sbin/mdconfig/mdconfig.c
+++ b/sbin/mdconfig/mdconfig.c
@@ -452,8 +452,8 @@ md_list(const char *units, int opt, const char *fflag)
}
gc = &pp->lg_config;
type = geom_config_get(gc, "type");
- if (strcmp(type, "vnode") == 0 ||
- strcmp(type, "preload") == 0) {
+ if (type != NULL && (strcmp(type, "vnode") == 0 ||
+ strcmp(type, "preload") == 0)) {
file = geom_config_get(gc, "file");
if (fflag != NULL &&
strcmp(fflag, file) != 0)