kmemleak: Allow the early log buffer to be configurable.
[safe/jmp/linux-2.6] / lib / decompress_inflate.c
index 163e66a..e36b296 100644 (file)
@@ -23,6 +23,7 @@
 #endif /* STATIC */
 
 #include <linux/decompress/mm.h>
+#include <linux/slab.h>
 
 #define INBUF_LEN (16*1024)
 
@@ -41,7 +42,7 @@ STATIC int INIT gunzip(unsigned char *buf, int len,
        set_error_fn(error_fn);
        rc = -1;
        if (flush) {
-               out_len = 0x8100; /* 32 K */
+               out_len = 0x8000; /* 32 K */
                out_buf = malloc(out_len);
        } else {
                out_len = 0x7fffffff; /* no limit */
@@ -97,7 +98,7 @@ STATIC int INIT gunzip(unsigned char *buf, int len,
                        strm->next_in++;
                strm->next_in++;
        }
-       strm->avail_in = len - 10;
+       strm->avail_in = len - (strm->next_in - zbuf);
 
        strm->next_out = out_buf;
        strm->avail_out = out_len;