From: Greg Beaver Date: Fri, 30 May 2008 22:49:33 +0000 (+0000) Subject: fix corrupted zips, fix postprocess for compressed zip file X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~125 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83e491b2c3b1527a2989fb46d7af8531240666a2;p=php fix corrupted zips, fix postprocess for compressed zip file --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 93a8cbb582..27afc67dc7 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1988,7 +1988,7 @@ int phar_postprocess_file(php_stream_wrapper *wrapper, int options, phar_entry_d /* construct actual offset to file start - local extra_len can be different from central extra_len */ entry->offset = entry->offset_abs = sizeof(local) + entry->header_offset + PHAR_ZIP_16(local.filename_len) + PHAR_ZIP_16(local.extra_len); - if (idata->zero != entry->offset_abs) { + if (idata->zero && idata->zero != entry->offset_abs) { idata->zero = entry->offset_abs; } } diff --git a/ext/phar/tests/zip/files/frontcontroller.phar.zip b/ext/phar/tests/zip/files/frontcontroller.phar.zip index 4ee905dd3a..28992ff6f9 100644 Binary files a/ext/phar/tests/zip/files/frontcontroller.phar.zip and b/ext/phar/tests/zip/files/frontcontroller.phar.zip differ diff --git a/ext/phar/tests/zip/files/frontcontroller10.phar.zip b/ext/phar/tests/zip/files/frontcontroller10.phar.zip index c37cb381fb..d206c89255 100644 Binary files a/ext/phar/tests/zip/files/frontcontroller10.phar.zip and b/ext/phar/tests/zip/files/frontcontroller10.phar.zip differ diff --git a/ext/phar/tests/zip/files/frontcontroller11.phar.zip b/ext/phar/tests/zip/files/frontcontroller11.phar.zip index 48e5fc678a..994218364d 100644 Binary files a/ext/phar/tests/zip/files/frontcontroller11.phar.zip and b/ext/phar/tests/zip/files/frontcontroller11.phar.zip differ diff --git a/ext/phar/tests/zip/files/frontcontroller12.phar.zip b/ext/phar/tests/zip/files/frontcontroller12.phar.zip index c086c4d4a4..e831e44302 100644 Binary files a/ext/phar/tests/zip/files/frontcontroller12.phar.zip and b/ext/phar/tests/zip/files/frontcontroller12.phar.zip differ diff --git a/ext/phar/tests/zip/files/frontcontroller2.phar.zip b/ext/phar/tests/zip/files/frontcontroller2.phar.zip index 7ef43dc000..3d7c0bbb1b 100644 Binary files a/ext/phar/tests/zip/files/frontcontroller2.phar.zip and b/ext/phar/tests/zip/files/frontcontroller2.phar.zip differ diff --git a/ext/phar/tests/zip/files/frontcontroller3.phar.zip b/ext/phar/tests/zip/files/frontcontroller3.phar.zip index 40c1d4994b..f167f2f6ef 100644 Binary files a/ext/phar/tests/zip/files/frontcontroller3.phar.zip and b/ext/phar/tests/zip/files/frontcontroller3.phar.zip differ diff --git a/ext/phar/tests/zip/files/frontcontroller4.phar.zip b/ext/phar/tests/zip/files/frontcontroller4.phar.zip index 4dc83408b0..1ad83f8a65 100644 Binary files a/ext/phar/tests/zip/files/frontcontroller4.phar.zip and b/ext/phar/tests/zip/files/frontcontroller4.phar.zip differ diff --git a/ext/phar/tests/zip/files/frontcontroller5.phar.zip b/ext/phar/tests/zip/files/frontcontroller5.phar.zip index 0ab0472101..7fa7ab61b7 100644 Binary files a/ext/phar/tests/zip/files/frontcontroller5.phar.zip and b/ext/phar/tests/zip/files/frontcontroller5.phar.zip differ diff --git a/ext/phar/tests/zip/files/frontcontroller6.phar.zip b/ext/phar/tests/zip/files/frontcontroller6.phar.zip index bf98255fe9..cb06618b7a 100644 Binary files a/ext/phar/tests/zip/files/frontcontroller6.phar.zip and b/ext/phar/tests/zip/files/frontcontroller6.phar.zip differ diff --git a/ext/phar/tests/zip/files/frontcontroller7.phar.zip b/ext/phar/tests/zip/files/frontcontroller7.phar.zip index 02fc3e27b6..0e97f27b00 100644 Binary files a/ext/phar/tests/zip/files/frontcontroller7.phar.zip and b/ext/phar/tests/zip/files/frontcontroller7.phar.zip differ diff --git a/ext/phar/tests/zip/files/frontcontroller8.phar.zip b/ext/phar/tests/zip/files/frontcontroller8.phar.zip index 41952ce745..d065cd5e58 100644 Binary files a/ext/phar/tests/zip/files/frontcontroller8.phar.zip and b/ext/phar/tests/zip/files/frontcontroller8.phar.zip differ diff --git a/ext/phar/tests/zip/files/frontcontroller9.phar.zip b/ext/phar/tests/zip/files/frontcontroller9.phar.zip index d3f4ff8404..82c4eb7024 100644 Binary files a/ext/phar/tests/zip/files/frontcontroller9.phar.zip and b/ext/phar/tests/zip/files/frontcontroller9.phar.zip differ