From: Hans Kristian Rosbach Date: Mon, 13 Feb 2017 19:38:35 +0000 (+0100) Subject: Fix only one half of a macro is executed in the correct side of the conditional, X-Git-Tag: 1.9.9-b1~691 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6bc599b1499e16cc6a1f6892ad346374c471e1a;p=thirdparty%2Fzlib-ng.git Fix only one half of a macro is executed in the correct side of the conditional, causing the potential for hash corruption on calls to deflateParam() to change level from 0 to something else. --- diff --git a/deflate.c b/deflate.c index a11b5ebda..30e5cb01c 100644 --- a/deflate.c +++ b/deflate.c @@ -552,10 +552,11 @@ int ZEXPORT deflateParams(z_stream *strm, int level, int strategy) { } if (s->level != level) { if (s->level == 0 && s->matches != 0) { - if (s->matches == 1) + if (s->matches == 1) { slide_hash(s); - else + } else { CLEAR_HASH(s); + } s->matches = 0; } s->level = level;