decompress_iob(): Cast value to unsigned char before shifting
[privoxy.git] / parsers.c
index 0866409..f905c92 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -609,7 +609,7 @@ jb_err decompress_iob(struct client_state *csp)
              */
             int skip_bytes;
             skip_bytes = *cur++;
-            skip_bytes += *cur++ << 8;
+            skip_bytes += (unsigned char)*cur++ << 8;
 
             /*
              * The number of bytes to skip should be positive
@@ -709,7 +709,7 @@ jb_err decompress_iob(struct client_state *csp)
    /*
     * Next, we allocate new storage for the inflated data.
     * We don't modify the existing iob yet, so in case there
-    * is error in decompression we can recover gracefully.
+    * is an error in decompression we can recover gracefully.
     */
    buf = zalloc(bufsize);
    if (NULL == buf)
@@ -778,8 +778,9 @@ jb_err decompress_iob(struct client_state *csp)
       }
       else
       {
+#ifndef NDEBUG
          char *oldnext_out = (char *)zstr.next_out;
-
+#endif
          /*
           * Update the fields for inflate() to use the new
           * buffer, which may be in a location different from