ia64/xen-unstable

changeset 9309:eceb7ffe1e67

Fix the gzip size extraction in xc_inflate_buffer(). Extract
bytes as unsigned quantities.

Signed-off-by: David Lively <dlively@virtualiron.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Mar 17 11:44:55 2006 +0100 (2006-03-17)
parents 03d7b5b2c212
children 843ced27531a
files tools/libxc/xg_private.c
line diff
     1.1 --- a/tools/libxc/xg_private.c	Fri Mar 17 11:00:46 2006 +0100
     1.2 +++ b/tools/libxc/xg_private.c	Fri Mar 17 11:44:55 2006 +0100
     1.3 @@ -77,10 +77,11 @@ char *xc_inflate_buffer(const char *in_b
     1.4          return (char *)in_buf;
     1.5      }
     1.6  
     1.7 -    out_len = in_buf[in_size-4] +
     1.8 -        (256 * (in_buf[in_size-3] +
     1.9 -                (256 * (in_buf[in_size-2] +
    1.10 -                        (256 * in_buf[in_size-1])))));
    1.11 +    out_len = (unsigned char)in_buf[in_size-4] +
    1.12 +        (256 * ((unsigned char)in_buf[in_size-3] +
    1.13 +                (256 * ((unsigned char)in_buf[in_size-2] +
    1.14 +                        (256 * (unsigned char)in_buf[in_size-1])))));
    1.15 +
    1.16      bzero(&zStream, sizeof(zStream));
    1.17      out_buf = malloc(out_len + 16);        /* Leave a little extra space */
    1.18      if ( out_buf == NULL )