zlib: Add initialization to satisfy valgrind
Restore the change from commit cf133ff6b3 (Fix uninitialized variable
access in zlib, 2009-11-18, v2.8.2~705). Their web site claims it does
no harm ( https://www.zlib.net/zlib_faq.html#faq36), but fixing it this
way eliminates the diagnostic.
diff --git a/Utilities/cmzlib/deflate.c b/Utilities/cmzlib/deflate.c
index 29ce1f6..5ec8374 100644
--- a/Utilities/cmzlib/deflate.c
+++ b/Utilities/cmzlib/deflate.c
@@ -285,6 +285,13 @@
s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
+
+ /* The following memset eliminates the valgrind uninitialized warning
+ "swept under the carpet" here:
+ http://www.zlib.net/zlib_faq.html#faq36 */
+
+ memset(s->window, 0, s->w_size*2*sizeof(Byte));
+
s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));