From: Wayne Davison Date: Sat, 16 Mar 2019 16:52:30 +0000 (-0700) Subject: Fix zlib CVE-2016-9842. X-Git-Tag: v3.2.0pre1~204 X-Git-Url: http://git.samba.org/samba.git/?p=rsync.git;a=commitdiff_plain;h=8eb50bce43634b9ef9ae940778ac08a959a7e8e4 Fix zlib CVE-2016-9842. --- diff --git a/zlib/inflate.c b/zlib/inflate.c index 5ed2390d..e43abd9e 100644 --- a/zlib/inflate.c +++ b/zlib/inflate.c @@ -1526,9 +1526,10 @@ z_streamp strm; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return -(1L << 16); + if (strm == Z_NULL || strm->state == Z_NULL) + return (long)(((unsigned long)0 - 1) << 16); state = (struct inflate_state FAR *)strm->state; - return ((long)(state->back) << 16) + + return (long)(((unsigned long)((long)state->back)) << 16) + (state->mode == COPY ? state->length : (state->mode == MATCH ? state->was - state->length : 0)); }