From 1c292cd806c6f0e5f7df2038583d3ea0f559f9f0 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 7 Sep 2015 20:55:14 +0000 Subject: [PATCH] In libz's inflateMark(), avoid left-shifting a negative integer, which is undefined. Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D3344 MFC after: 3 days --- lib/libz/inflate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libz/inflate.c b/lib/libz/inflate.c index 870f89bb4d3..b51a8a50ad8 100644 --- a/lib/libz/inflate.c +++ b/lib/libz/inflate.c @@ -1504,7 +1504,7 @@ 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 -(1L << 16); state = (struct inflate_state FAR *)strm->state; return ((long)(state->back) << 16) + (state->mode == COPY ? state->length : -- 2.45.2