summaryrefslogtreecommitdiff
path: root/gzlib.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2015-07-05 18:14:53 -0700
committerMark Adler <madler@alumni.caltech.edu>2015-07-05 18:14:53 -0700
commit95698093f023852ca4365df307c19a1d7cfa3687 (patch)
tree743b907c5449f617343e8bec546eabbb650df0a8 /gzlib.c
parent8a979f6c7986574e37316148cd8ca440c3bc08a3 (diff)
downloadzlib-95698093f023852ca4365df307c19a1d7cfa3687.tar.gz
Improve speed of gzprintf() in transparent mode.
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 ced2cb8..3e344f9 100644
--- a/gzlib.c
+++ b/gzlib.c
@@ -331,6 +331,8 @@ int ZEXPORT gzbuffer(file, 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;