Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Sep 2015 20:55:15 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r287541 - head/lib/libz
Message-ID:  <201509072055.t87KtFCU070392@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Mon Sep  7 20:55:14 2015
New Revision: 287541
URL: https://svnweb.freebsd.org/changeset/base/287541

Log:
  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

Modified:
  head/lib/libz/inflate.c

Modified: head/lib/libz/inflate.c
==============================================================================
--- head/lib/libz/inflate.c	Mon Sep  7 20:05:56 2015	(r287540)
+++ head/lib/libz/inflate.c	Mon Sep  7 20:55:14 2015	(r287541)
@@ -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 :



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509072055.t87KtFCU070392>