summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2023-08-14 17:01:54 -0700
committerMark Adler <madler@alumni.caltech.edu>2023-08-14 17:01:54 -0700
commitd98251478246c8ef2f405d76e4ef1678c14d7eda (patch)
tree28f3e5f3329cec6b29ad43997539a949d07db683
parent6951bc609b5f70d07b752e33c340da334a30df3a (diff)
downloadzlib-d98251478246c8ef2f405d76e4ef1678c14d7eda.tar.gz
zlib-d98251478246c8ef2f405d76e4ef1678c14d7eda.tar.bz2
zlib-d98251478246c8ef2f405d76e4ef1678c14d7eda.zip
Fix bug when using gzflush() with a very small buffer.
-rw-r--r--gzlib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gzlib.c b/gzlib.c
index 2b446c4..29fc448 100644
--- a/gzlib.c
+++ b/gzlib.c
@@ -308,8 +308,8 @@ int ZEXPORT gzbuffer(gzFile file, unsigned size) {
308 /* check and set requested size */ 308 /* check and set requested size */
309 if ((size << 1) < size) 309 if ((size << 1) < size)
310 return -1; /* need to be able to double it */ 310 return -1; /* need to be able to double it */
311 if (size < 2) 311 if (size < 8)
312 size = 2; /* need two bytes to check magic header */ 312 size = 8; /* needed to behave well with flushing */
313 state->want = size; 313 state->want = size;
314 return 0; 314 return 0;
315} 315}