From: Greg Beaver Date: Fri, 30 May 2008 22:49:46 +0000 (+0000) Subject: MFB: fix corrupted zips, fix postprocess for compressed zip file X-Git-Tag: BEFORE_HEAD_NS_CHANGE~1624 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6db7baba992f4e2a8d9e16f55c1a7be04642a260;p=php MFB: 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..ce37065ab7 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..84d962e993 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..3f55bd0d82 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..f58118ebb2 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..324b704fc6 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..c49a2667f3 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..c73337456e 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..aca9a88acf 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..6c0c489c0d 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..8fcd3bbc2a 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..046f29d13e 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..a00878deaf 100644 Binary files a/ext/phar/tests/zip/files/frontcontroller9.phar.zip and b/ext/phar/tests/zip/files/frontcontroller9.phar.zip differ