From 6c97c325ff6d8442b0c168cdb5fd0a4b4ba0340e Mon Sep 17 00:00:00 2001 From: Xin LI Date: Mon, 30 Jun 2008 15:21:42 +0000 Subject: [PATCH] Avoid NULL deference. Reviewed by: ivoras --- sys/geom/virstor/g_virstor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/geom/virstor/g_virstor.c b/sys/geom/virstor/g_virstor.c index dfbe5c6aae3b..1de3d5ae28e4 100644 --- a/sys/geom/virstor/g_virstor.c +++ b/sys/geom/virstor/g_virstor.c @@ -225,6 +225,11 @@ virstor_ctl_stop(struct gctl_req *req, struct g_class *cp) sprintf(param, "arg%d", i); name = gctl_get_asciiparam(req, param); + if (name == NULL) { + gctl_error(req, "No 'arg%d' argument", i); + g_topology_unlock(); + return; + } sc = virstor_find_geom(cp, name); LOG_MSG(LVL_INFO, "Stopping %s by the userland command", sc->geom->name);