Browse code

Adjustment to Zip extraction logic to make Z_BUF_ERROR error code non-fatal, allowing scans of partially decompressed files.

Micah Snyder (micasnyd) authored on 2018/10/25 23:09:51
Showing 1 changed files
... ...
@@ -173,7 +173,7 @@ static int unz(const uint8_t *src, uint32_t csize, uint32_t usize, uint16_t meth
173 173
       break;
174 174
     }
175 175
     unz_end(&strm);
176
-    if (res == Z_STREAM_END) res=0;
176
+    if ((res == Z_STREAM_END) | (res == Z_BUF_ERROR)) res=0;
177 177
     break;
178 178
   }
179 179