From cd35e8927f5f99686aba54272ee5777c2781710a Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Tue, 20 Jul 2010 12:51:12 -0400 Subject: [PATCH] Fix a NULL dereference in the case that the arg in question didn't exist. Signed-off-by: Chris Lalancette --- tools/virsh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh.c b/tools/virsh.c index 17c3074403..354feb0c29 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -9771,7 +9771,7 @@ vshCommandOptString(const vshCmd *cmd, const char *name, int *found) if (arg && arg->data && *arg->data) return arg->data; - if ((arg->def->flag) & VSH_OFLAG_REQ) + if (arg && arg->def && ((arg->def->flag) & VSH_OFLAG_REQ)) vshError(NULL, _("Missing required option '%s'"), name); return NULL;