← Commit list

0866b3690

Joakim Tjernlund
Joakim Tjernlund
2010-02-11
FAILED Duration: 36s

Subject

gunzip: inflate_codes(): add fix from upstream gzip to prevent false CRC error

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

archival/libunarchive/decompress_unzip.c+4 -1
@@ -575,13 +575,16 @@ static NOINLINE int inflate_codes(STATE_PARAM_ONLY)
do {
/* Was: nn -= (e = (e = GUNZIP_WSIZE - ((dd &= GUNZIP_WSIZE - 1) > w ? dd : w)) > nn ? nn : e); */
/* Who wrote THAT?? rewritten as: */
+ unsigned delta;
+
dd &= GUNZIP_WSIZE - 1;
e = GUNZIP_WSIZE - (dd > w ? dd : w);
+ delta = w > dd ? w - dd : dd - w;
if (e > nn) e = nn;
nn -= e;
/* copy to new buffer to prevent possible overwrite */
- if (w - dd >= e) { /* (this test assumes unsigned comparison) */
+ if (delta >= e) {
memcpy(gunzip_window + w, gunzip_window + dd, e);
w += e;
dd += e;