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(a)redhat.com>
---
src/util/virxml.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virxml.c b/src/util/virxml.c
index a47a5d49fc..d80a69f163 100644
--- a/src/util/virxml.c
+++ b/src/util/virxml.c
@@ -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;
--
2.37.3