mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-09-10 21:45:18 +03:00
Fix a NULL dereference in the case that the arg in question
didn't exist. Signed-off-by: Chris Lalancette <clalance@redhat.com>
This commit is contained in:
@@ -9771,7 +9771,7 @@ vshCommandOptString(const vshCmd *cmd, const char *name, int *found)
|
|||||||
if (arg && arg->data && *arg->data)
|
if (arg && arg->data && *arg->data)
|
||||||
return 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);
|
vshError(NULL, _("Missing required option '%s'"), name);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user