Commit a05eacf for zlib
commit a05eacf0bdc728a5583311457dc4c2152bc57313
Author: Darren Carreras <283775510+carrerasdarren-cell@users.noreply.github.com>
Date: Fri Aug 7 10:06:24 2026 -0400
Fix bug where a complete gzip stream can be reported as truncated.
diff --git a/gzread.c b/gzread.c
index 424f704..98908c4 100644
--- a/gzread.c
+++ b/gzread.c
@@ -125,6 +125,13 @@ local int gz_look(gz_statep state) {
if we're looking for a gzip member after the first one, which is not at
the start, then proceed directly to look for a gzip member next */
if (state->direct == -1 || state->junk == 0) {
+ /* wait for input before committing to another gzip member */
+ if (state->junk == 0 && strm->avail_in == 0) {
+ if (gz_avail(state) == -1)
+ return -1;
+ if (strm->avail_in == 0)
+ return 0;
+ }
inflateReset(strm);
state->how = GZIP;
state->junk = state->junk != -1;