提交 cd35e892 编写于 作者: C Chris Lalancette

Fix a NULL dereference in the case that the arg in question

didn't exist.
Signed-off-by: NChris Lalancette <clalance@redhat.com>
上级 4d134188
...@@ -9771,7 +9771,7 @@ vshCommandOptString(const vshCmd *cmd, const char *name, int *found) ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册