Checker showed that zlib was using a element of its internal state
authorAndrew Tridgell <tridge@samba.org>
Tue, 16 Dec 1997 18:18:02 +0000 (18:18 +0000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 16 Dec 1997 18:18:02 +0000 (18:18 +0000)
structure without initialising it. Although it looks harmless I've
added a bzero() to make absolutely sure that the code behaves
consistently across platforms.

lib/zlib.c

index c9f7ff5..9d732bb 100644 (file)
@@ -600,6 +600,7 @@ int deflateInit2 (strm, level, method, windowBits, memLevel, strategy)
     }
     s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
     if (s == Z_NULL) return Z_MEM_ERROR;
+    bzero(s, sizeof(*s));
     strm->state = (struct internal_state FAR *)s;
     s->strm = strm;