提交 1d816219 编写于 作者: J John Ferlan

virsh: Resolve possible NULL dereference

Coverity found that commit '41b5e845' had a possible NULL dereference on
arg->data processing
上级 277aaeee
/*
* virsh.c: a shell to exercise the libvirt API
*
* Copyright (C) 2005, 2007-2012 Red Hat, Inc.
* Copyright (C) 2005, 2007-2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -1475,7 +1475,7 @@ vshCommandOptStringReq(vshControl *ctl,
if (!arg->data)
error = N_("Programming error: Requested option is a boolean");
if (!*arg->data && !(arg->def->flags & VSH_OFLAG_EMPTY_OK))
if (arg->data && !*arg->data && !(arg->def->flags & VSH_OFLAG_EMPTY_OK))
error = N_("Option argument is empty");
if (error) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册