mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
util: xml: Disallow aliasing of negative numbers in virXPathUInt
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 int from XPaths. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
8989b3a54d
commit
3e3c52f10f
@ -253,7 +253,7 @@ virXPathUIntBase(const char *xpath,
|
||||
if (!(obj = virXPathEvalString(xpath, ctxt)))
|
||||
return -1;
|
||||
|
||||
if (virStrToLong_ui((char *) obj->stringval, NULL, base, value) < 0)
|
||||
if (virStrToLong_uip((char *) obj->stringval, NULL, base, value) < 0)
|
||||
return -2;
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user