summaryrefslogtreecommitdiff
path: root/gzlib.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2015-11-03 18:42:14 +0100
committerHans Kristian Rosbach <hk-git@circlestorm.org>2015-11-03 18:43:48 +0100
commit48e985b618b95a0e49587cbe6b18aea7f9117075 (patch)
treeb9b85f8a4ca1b9dca427ea930e067088f3134bcd /gzlib.c
parent0c1581a5171b6793deccb9632a92f05d9691b3bb (diff)
Improve speed of gzprintf() in transparent mode.
A few minor modifications done to help with conflicts.
Diffstat (limited to 'gzlib.c')
-rw-r--r--gzlib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gzlib.c b/gzlib.c
index 50e2c50..2873202 100644
--- a/gzlib.c
+++ b/gzlib.c
@@ -251,6 +251,8 @@ int ZEXPORT gzbuffer(gzFile file, unsigned size) {
return -1;
/* check and set requested size */
+ if ((size << 1) < size)
+ return -1; /* need to be able to double it */
if (size < 2)
size = 2; /* need two bytes to check magic header */
state->want = size;