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>
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;