]> granicus.if.org Git - php/commitdiff
MFB: fix corrupted zips, fix postprocess for compressed zip file
authorGreg Beaver <cellog@php.net>
Fri, 30 May 2008 22:49:46 +0000 (22:49 +0000)
committerGreg Beaver <cellog@php.net>
Fri, 30 May 2008 22:49:46 +0000 (22:49 +0000)
13 files changed:
ext/phar/phar.c
ext/phar/tests/zip/files/frontcontroller.phar.zip
ext/phar/tests/zip/files/frontcontroller10.phar.zip
ext/phar/tests/zip/files/frontcontroller11.phar.zip
ext/phar/tests/zip/files/frontcontroller12.phar.zip
ext/phar/tests/zip/files/frontcontroller2.phar.zip
ext/phar/tests/zip/files/frontcontroller3.phar.zip
ext/phar/tests/zip/files/frontcontroller4.phar.zip
ext/phar/tests/zip/files/frontcontroller5.phar.zip
ext/phar/tests/zip/files/frontcontroller6.phar.zip
ext/phar/tests/zip/files/frontcontroller7.phar.zip
ext/phar/tests/zip/files/frontcontroller8.phar.zip
ext/phar/tests/zip/files/frontcontroller9.phar.zip

index 93a8cbb582cdffeb3062ea9687b0246f36e50812..27afc67dc74f35d032380740fd00abe96d7352d3 100644 (file)
@@ -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;
                }
        }
index 4ee905dd3ae892298fd6c4a01c17d0e5253f5e81..ce37065ab7a3befae2665c7b6e99b20f2eaa8b00 100644 (file)
Binary files a/ext/phar/tests/zip/files/frontcontroller.phar.zip and b/ext/phar/tests/zip/files/frontcontroller.phar.zip differ
index c37cb381fbed023f0f7a757b783f245dcab01fc3..84d962e9931aef153a3f48eb1780bb46c92b4ea5 100644 (file)
Binary files a/ext/phar/tests/zip/files/frontcontroller10.phar.zip and b/ext/phar/tests/zip/files/frontcontroller10.phar.zip differ
index 48e5fc678a43c94f27c859e904ffa5071c287d9d..3f55bd0d82049497879445fc12118310eb1ef9d0 100644 (file)
Binary files a/ext/phar/tests/zip/files/frontcontroller11.phar.zip and b/ext/phar/tests/zip/files/frontcontroller11.phar.zip differ
index c086c4d4a43a4cb647ec15b11a81e2d4dbfe3496..f58118ebb2d8499e73dd749dfaa647f199276bbc 100644 (file)
Binary files a/ext/phar/tests/zip/files/frontcontroller12.phar.zip and b/ext/phar/tests/zip/files/frontcontroller12.phar.zip differ
index 7ef43dc000c401ff2cf07a22cd6a146116ec5031..324b704fc67179b38a5f457c55a1ab913ba1a0b3 100644 (file)
Binary files a/ext/phar/tests/zip/files/frontcontroller2.phar.zip and b/ext/phar/tests/zip/files/frontcontroller2.phar.zip differ
index 40c1d4994b313927ce0369daeda06ace70309b54..c49a2667f3ab51b4686a65951331acc104480f32 100644 (file)
Binary files a/ext/phar/tests/zip/files/frontcontroller3.phar.zip and b/ext/phar/tests/zip/files/frontcontroller3.phar.zip differ
index 4dc83408b059aa3f388e8c0ce12584827a315f1b..c73337456e2566acaac37aad333e19029c60cc66 100644 (file)
Binary files a/ext/phar/tests/zip/files/frontcontroller4.phar.zip and b/ext/phar/tests/zip/files/frontcontroller4.phar.zip differ
index 0ab0472101505cd2e2107ff9bf5dfa1f23d700c0..aca9a88acf2f929c2bff6c9e188fe9658ba14470 100644 (file)
Binary files a/ext/phar/tests/zip/files/frontcontroller5.phar.zip and b/ext/phar/tests/zip/files/frontcontroller5.phar.zip differ
index bf98255fe9a9d85b6c41c16d9eb104d9a5e93cd7..6c0c489c0d07ebcec9f558cdc2ee9c7dff85c9be 100644 (file)
Binary files a/ext/phar/tests/zip/files/frontcontroller6.phar.zip and b/ext/phar/tests/zip/files/frontcontroller6.phar.zip differ
index 02fc3e27b6970ab9ce9db3c5ee8f2436574ac197..8fcd3bbc2af12b89494c88997530f3f2c72ec38d 100644 (file)
Binary files a/ext/phar/tests/zip/files/frontcontroller7.phar.zip and b/ext/phar/tests/zip/files/frontcontroller7.phar.zip differ
index 41952ce745a92d3d6b64db7e8f5c6e0cc8c6d4a3..046f29d13ed16fd4ae6984c8a20ebdc677b56fe0 100644 (file)
Binary files a/ext/phar/tests/zip/files/frontcontroller8.phar.zip and b/ext/phar/tests/zip/files/frontcontroller8.phar.zip differ
index d3f4ff84042959c0b7ba0a17bbac03781cd212a8..a00878deaf7c150b9f517400b8057d002570cfc2 100644 (file)
Binary files a/ext/phar/tests/zip/files/frontcontroller9.phar.zip and b/ext/phar/tests/zip/files/frontcontroller9.phar.zip differ