summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/fstream/compress/gzip.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/fstream/compress/gzip.c b/lib/fstream/compress/gzip.c
index e69f183..b73a258 100644
--- a/lib/fstream/compress/gzip.c
+++ b/lib/fstream/compress/gzip.c
@@ -20,6 +20,9 @@ static int flush_inbuf(ostream_comp_t *base, bool finish)
size_t have;
int ret;
+ if (base->inbuf_used > sizeof(base->inbuf))
+ base->inbuf_used = sizeof(base->inbuf);
+
if (sizeof(size_t) > sizeof(uInt)) {
gzip->strm.avail_in = ~((uInt)0);