]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed use of uninitialized value found by memory sanitizer and reported by @sebpop.
authorNathan Moinvaziri <nathan@nathanm.com>
Wed, 17 Jul 2019 03:00:33 +0000 (20:00 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 18 Jul 2019 09:58:04 +0000 (11:58 +0200)
gzwrite.c

index 20e1d5c63fadabcfabbd8d1d837bbe465169e34b..5b128055bfdb603e27dd76cf3cb93ee2523c2da0 100644 (file)
--- a/gzwrite.c
+++ b/gzwrite.c
@@ -26,6 +26,7 @@ static int gz_init(gz_state *state) {
         gz_error(state, Z_MEM_ERROR, "out of memory");
         return -1;
     }
+    memset(state->in, 0, state->want << 1);
 
     /* only need output buffer and deflate state if compressing */
     if (!state->direct) {