From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 01/13] libxl: fix unsigned less-than-0 comparison in e820_sanitize Date: Fri, 13 Dec 2013 13:23:09 +0000 Message-ID: <52AB0A3D.5090104@citrix.com> References: <1385892907-20084-1-git-send-email-mattd@bugfuzz.com> <1385892907-20084-2-git-send-email-mattd@bugfuzz.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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 , Xen-devel Cc: Ian Jackson , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 13/12/2013 05:54, Matthew Daley wrote: > Ping? > > On Sun, Dec 1, 2013 at 11:14 PM, Matthew Daley wrote: >> Both src[i].size and delta are unsigned, so checking their difference >> for being less than 0 doesn't work. >> >> Coverity-ID: 1055615 >> Signed-off-by: Matthew Daley Reviewed-by: Andrew Cooper >> --- >> tools/libxl/libxl_x86.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c >> index e1c183f..b11d036 100644 >> --- a/tools/libxl/libxl_x86.c >> +++ b/tools/libxl/libxl_x86.c >> @@ -125,7 +125,7 @@ static int e820_sanitize(libxl_ctx *ctx, struct e820entry src[], >> src[i].type = E820_UNUSABLE; >> delta = ram_end - src[i].addr; >> /* The end < ram_end should weed this out */ >> - if (src[i].size - delta < 0) >> + if (src[i].size < delta) >> src[i].type = 0; >> else { >> src[i].size -= delta; >> -- >> 1.7.10.4 >> > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel