From: Mark Adler Date: Mon, 21 Aug 2023 20:49:50 +0000 (-0700) Subject: Fix bug when using gzflush() with a very small buffer. X-Git-Tag: 2.1.4~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe44e1f1dfa7698b8f42a6eeb392548d3fdf9a81;p=thirdparty%2Fzlib-ng.git Fix bug when using gzflush() with a very small buffer. --- diff --git a/gzlib.c b/gzlib.c index e1290fc61..e613837ef 100644 --- a/gzlib.c +++ b/gzlib.c @@ -274,8 +274,8 @@ int Z_EXPORT PREFIX(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; }