xenstat: fix unsigned less-than-0 comparison
authorMatthew Daley <mattd@bugfuzz.com>
Sun, 4 May 2014 08:31:46 +0000 (20:31 +1200)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 8 May 2014 09:48:15 +0000 (10:48 +0100)
Commit 1438d36f ("xenstat: Fix buffer over-run with new_domains being
negative.") attempted to fix the handling of a negative error result
from xc_domain_getinfolist in xenstat_get_node. However, it forgot to
change the result variable from an unsigned type to a signed one.

Do so, allowing the error result to be handled properly.

Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/xenstat/libxenstat/src/xenstat.c

index e5facb84f55ea4f4493e3b1a34586bb74f2d1e96..8072a90047aced2c1a0e4fce7de2c83a23321e05 100644 (file)
@@ -164,7 +164,7 @@ xenstat_node *xenstat_get_node(xenstat_handle * handle, unsigned int flags)
        xenstat_node *node;
        xc_physinfo_t physinfo = { 0 };
        xc_domaininfo_t domaininfo[DOMAIN_CHUNK_SIZE];
-       unsigned int new_domains;
+       int new_domains;
        unsigned int i;
 
        /* Create the node */