提交 739ea3ce 编写于 作者: P Pavel Hrdina

virsh: reject negative values for scaled integer

Some virsh commands have a size parameter, which is handled as scaled
integer.  We don't have any *feature* that would allow to use '-1' as
maximum size, so it's safe to reject any negative values for those
commands.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1159171Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 e971921a
......@@ -1811,7 +1811,7 @@ vshCommandOptScaledInt(const vshCmd *cmd, const char *name,
ret = vshCommandOptString(cmd, name, &str);
if (ret <= 0)
return ret;
if (virStrToLong_ull(str, &end, 10, value) < 0 ||
if (virStrToLong_ullp(str, &end, 10, value) < 0 ||
virScaleInteger(value, end, scale, max) < 0)
return -1;
return 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册