mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34: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:
parent
4d13418890
commit
cd35e8927f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user