From d98251478246c8ef2f405d76e4ef1678c14d7eda Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Mon, 14 Aug 2023 17:01:54 -0700 Subject: Fix bug when using gzflush() with a very small buffer. --- gzlib.c | 4 ++-- 1 file 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) { /* 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 */ + if (size < 8) + size = 8; /* needed to behave well with flushing */ state->want = size; return 0; } -- cgit v1.2.3-55-g6feb