From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 1/2] xenstat: fix unsigned less-than-0 comparison Date: Mon, 5 May 2014 10:32:10 -0400 Message-ID: <20140505143210.GC3878@phenom.dumpdata.com> References: <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: Content-Disposition: inline In-Reply-To: <1399192307-6426-1-git-send-email-mattd@bugfuzz.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Matthew Daley Cc: xen-devel@lists.xenproject.org, Stefano Stabellini , Ian Jackson , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Sun, May 04, 2014 at 08:31:46PM +1200, Matthew Daley wrote: > 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 Reviewed-by: Konrad Rzeszutek Wilk I was looking at this by changing the underlay libxc calls to using 'unsigned' instead of 'int' but that has kind of been preempted. Thanks for fixing it! > --- > 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 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel