summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2013-07-03 20:25:30 +0200
committerHelge Deller <deller@gmx.de>2013-07-03 20:25:30 +0200
commit13e5e74c0c85aeaf89b92ca0559a832841d27f94 (patch)
treeedf2e6e64bc8bb1400377e6dedd1f4b2ad3f6fd4
parent37dede1b6c5caf5023f524c2382d1caa5e523524 (diff)
downloadpalo-13e5e74c0c85aeaf89b92ca0559a832841d27f94.tar.gz
Check against overflow of internal buffer.
Drop unnecessary and confusing debug info.
-rw-r--r--lib/gzip.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gzip.c b/lib/gzip.c
index 8923545..21234c9 100644
--- a/lib/gzip.c
+++ b/lib/gzip.c
@@ -192,9 +192,14 @@ int prepare_GZIP_loadable(int fd, struct loadable *loadable, int *wide)
mark(&keep_unzipped);
outptrlim = outptr + MAX_GZ_LEN;
- printf("uncompressing %s to 0x%p", orig_filename, outptr);
+ if (0)
+ printf("uncompressing %s to 0x%p", orig_filename, outptr);
+ else
+ printf("uncompressing Linux kernel");
bytes_len = decompress(outptr, outptrlim);
+ if (bytes_len > MAX_GZ_LEN)
+ printf("\nERROR: Internal buffer MAX_GZ_LEN too small!");
if (bytes_len < 0) {
release(release_all_mallocs);
return PREPARE_CONTINUE;