[4.1] c440f0e Adopt libz/libvgz fix from FreeBSD:

Poul-Henning Kamp phk at FreeBSD.org
Mon Sep 28 13:31:07 CEST 2015


commit c440f0e69325429a58fa648d07232f637573e4f6
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Sep 21 11:26:20 2015 +0000

    Adopt libz/libvgz fix from FreeBSD:
    
      r287541 | dim | 2015-09-07 20:55:14 +0000 (Mon, 07 Sep 2015) | 7 lines
    
      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

diff --git a/lib/libvgz/inflate.c b/lib/libvgz/inflate.c
index e3e9fce..5c1a641 100644
--- a/lib/libvgz/inflate.c
+++ b/lib/libvgz/inflate.c
@@ -1510,7 +1510,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 :



More information about the varnish-commit mailing list