mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
util: xml: Disallow aliasing of negative numbers in virXPathULongLong
Passing negative number as an alias for the max value is an anti-feature we unfortunately allowed in virsh, but luckily never encouraged in the XML. Refuse numbers with negative sign when parsing unsigned long long from XPaths. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
fd97c85b95
commit
e8ea7ac579
@ -323,7 +323,7 @@ virXPathULongLong(const char *xpath,
|
||||
if (!(obj = virXPathEvalString(xpath, ctxt)))
|
||||
return -1;
|
||||
|
||||
if (virStrToLong_ull((char *) obj->stringval, NULL, 10, value) < 0)
|
||||
if (virStrToLong_ullp((char *) obj->stringval, NULL, 10, value) < 0)
|
||||
return -2;
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user