From: Matthew Daley Date: Thu, 31 Oct 2013 02:58:53 +0000 (+1300) Subject: libxc: fix retrieval of and remove pointless check on gzip size X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6110 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e9fa4c863623eb169cbf6f282921b00dac698ed5;p=xen.git libxc: fix retrieval of and remove pointless check on gzip size Coverity-ID: 1055587 Coverity-ID: 1055963 Signed-off-by: Matthew Daley Reviewed-by: Andrew Cooper Acked-by: Ian Campbell --- diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c index 0f367f6b8b..3bf51efd64 100644 --- a/tools/libxc/xc_dom_core.c +++ b/tools/libxc/xc_dom_core.c @@ -294,8 +294,8 @@ size_t xc_dom_check_gzip(xc_interface *xch, void *blob, size_t ziplen) return 0; gzlen = blob + ziplen - 4; - unziplen = gzlen[3] << 24 | gzlen[2] << 16 | gzlen[1] << 8 | gzlen[0]; - if ( (unziplen < 0) || (unziplen > XC_DOM_DECOMPRESS_MAX) ) + unziplen = (size_t)gzlen[3] << 24 | gzlen[2] << 16 | gzlen[1] << 8 | gzlen[0]; + if ( unziplen > XC_DOM_DECOMPRESS_MAX ) { xc_dom_printf (xch,