From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Daley Subject: [PATCH 1/2] xenstat: fix unsigned less-than-0 comparison Date: Sun, 4 May 2014 20:31:46 +1200 Message-ID: <1399192307-6426-1-git-send-email-mattd@bugfuzz.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: xen-devel@lists.xen.org, Matthew Daley , Ian Jackson , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org 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 --- tools/xenstat/libxenstat/src/xenstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/xenstat/libxenstat/src/xenstat.c b/tools/xenstat/libxenstat/src/xenstat.c index e5facb8..8072a90 100644 --- a/tools/xenstat/libxenstat/src/xenstat.c +++ b/tools/xenstat/libxenstat/src/xenstat.c @@ -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 */ -- 1.9.2