[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Fix the gzip size extraction in xc_inflate_buffer(). Extract



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID eceb7ffe1e67e9063c9a809e9af74b95057a08f8
# Parent  03d7b5b2c212f2fe551737855e9c39f00675d06c
Fix the gzip size extraction in xc_inflate_buffer(). Extract
bytes as unsigned quantities.

Signed-off-by: David Lively <dlively@xxxxxxxxxxxxxxx>

diff -r 03d7b5b2c212 -r eceb7ffe1e67 tools/libxc/xg_private.c
--- a/tools/libxc/xg_private.c  Fri Mar 17 10:00:46 2006
+++ b/tools/libxc/xg_private.c  Fri Mar 17 10:44:55 2006
@@ -77,10 +77,11 @@
         return (char *)in_buf;
     }
 
-    out_len = in_buf[in_size-4] +
-        (256 * (in_buf[in_size-3] +
-                (256 * (in_buf[in_size-2] +
-                        (256 * in_buf[in_size-1])))));
+    out_len = (unsigned char)in_buf[in_size-4] +
+        (256 * ((unsigned char)in_buf[in_size-3] +
+                (256 * ((unsigned char)in_buf[in_size-2] +
+                        (256 * (unsigned char)in_buf[in_size-1])))));
+
     bzero(&zStream, sizeof(zStream));
     out_buf = malloc(out_len + 16);        /* Leave a little extra space */
     if ( out_buf == NULL )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.