]> granicus.if.org Git - php/commitdiff
fix corrupted zips, fix postprocess for compressed zip file
authorGreg Beaver <cellog@php.net>
Fri, 30 May 2008 22:49:33 +0000 (22:49 +0000)
committerGreg Beaver <cellog@php.net>
Fri, 30 May 2008 22:49:33 +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..28992ff6f9ddeca447e495e81beb25454acfee46 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..d206c892558c00b81917d93d317a49e5ae923a6a 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..994218364d133f623c6aa6040f22b053bff3d719 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..e831e44302e762883b2f82b9cac9b28abb87eb1f 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..3d7c0bbb1b8ad5af4fa4948c9265e2a075e43810 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..f167f2f6efbaa5312231c70e0939444869ccd20d 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..1ad83f8a65201f127bfc83ede1f4a3f34f43240c 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..7fa7ab61b7754cc3a56336aca3509e93d3df0e8f 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..cb06618b7aec9f32960c780b0aec779f523be9d7 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..0e97f27b00e0dac370a587877a7abc2ae5c286b8 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..d065cd5e588fc7da6e972f426b66a09e8f8215c2 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..82c4eb7024609a910ea7a7e1e1f9beeb2b770c0e 100644 (file)
Binary files a/ext/phar/tests/zip/files/frontcontroller9.phar.zip and b/ext/phar/tests/zip/files/frontcontroller9.phar.zip differ