diff --git a/gzip.c b/gzip.c index b867350..1153bde 100644 --- a/gzip.c +++ b/gzip.c @@ -561,6 +561,19 @@ int main (int argc, char **argv) SET_BINARY_MODE(fileno(stdout)); } while (optind < argc) { + + /* Make sure buffers are reset to 0 to ensure reproducibility when handling several files */ + ZEROIFY(uch, inbuf, INBUFSIZ +INBUF_EXTRA); + ZEROIFY(uch, outbuf, OUTBUFSIZ+OUTBUF_EXTRA); + ZEROIFY(ush, d_buf, DIST_BUFSIZE); + ZEROIFY(uch, window, 2L*WSIZE); +#ifndef MAXSEG_64K + ZEROIFY(ush, tab_prefix, 1L<