summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2008-05-30 22:49:33 +0000
committerGreg Beaver <cellog@php.net>2008-05-30 22:49:33 +0000
commit83e491b2c3b1527a2989fb46d7af8531240666a2 (patch)
tree7bb4e05ab754af8fc786155db31f175af1e5173e
parent8b600a72dc3ab4f4cbb1e583154732a34743ea28 (diff)
downloadphp-git-83e491b2c3b1527a2989fb46d7af8531240666a2.tar.gz
fix corrupted zips, fix postprocess for compressed zip file
-rw-r--r--ext/phar/phar.c2
-rw-r--r--ext/phar/tests/zip/files/frontcontroller.phar.zipbin625 -> 804 bytes
-rw-r--r--ext/phar/tests/zip/files/frontcontroller10.phar.zipbin471 -> 796 bytes
-rw-r--r--ext/phar/tests/zip/files/frontcontroller11.phar.zipbin461 -> 783 bytes
-rw-r--r--ext/phar/tests/zip/files/frontcontroller12.phar.zipbin465 -> 786 bytes
-rw-r--r--ext/phar/tests/zip/files/frontcontroller2.phar.zipbin531 -> 677 bytes
-rw-r--r--ext/phar/tests/zip/files/frontcontroller3.phar.zipbin826 -> 816 bytes
-rw-r--r--ext/phar/tests/zip/files/frontcontroller4.phar.zipbin822 -> 812 bytes
-rw-r--r--ext/phar/tests/zip/files/frontcontroller5.phar.zipbin554 -> 707 bytes
-rw-r--r--ext/phar/tests/zip/files/frontcontroller6.phar.zipbin559 -> 709 bytes
-rw-r--r--ext/phar/tests/zip/files/frontcontroller7.phar.zipbin559 -> 710 bytes
-rw-r--r--ext/phar/tests/zip/files/frontcontroller8.phar.zipbin684 -> 896 bytes
-rw-r--r--ext/phar/tests/zip/files/frontcontroller9.phar.zipbin697 -> 923 bytes
13 files changed, 1 insertions, 1 deletions
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
--- a/ext/phar/tests/zip/files/frontcontroller.phar.zip
+++ b/ext/phar/tests/zip/files/frontcontroller.phar.zip
Binary files 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
--- a/ext/phar/tests/zip/files/frontcontroller10.phar.zip
+++ b/ext/phar/tests/zip/files/frontcontroller10.phar.zip
Binary files 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
--- a/ext/phar/tests/zip/files/frontcontroller11.phar.zip
+++ b/ext/phar/tests/zip/files/frontcontroller11.phar.zip
Binary files 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
--- a/ext/phar/tests/zip/files/frontcontroller12.phar.zip
+++ b/ext/phar/tests/zip/files/frontcontroller12.phar.zip
Binary files 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
--- a/ext/phar/tests/zip/files/frontcontroller2.phar.zip
+++ b/ext/phar/tests/zip/files/frontcontroller2.phar.zip
Binary files 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
--- a/ext/phar/tests/zip/files/frontcontroller3.phar.zip
+++ b/ext/phar/tests/zip/files/frontcontroller3.phar.zip
Binary files 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
--- a/ext/phar/tests/zip/files/frontcontroller4.phar.zip
+++ b/ext/phar/tests/zip/files/frontcontroller4.phar.zip
Binary files 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
--- a/ext/phar/tests/zip/files/frontcontroller5.phar.zip
+++ b/ext/phar/tests/zip/files/frontcontroller5.phar.zip
Binary files 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
--- a/ext/phar/tests/zip/files/frontcontroller6.phar.zip
+++ b/ext/phar/tests/zip/files/frontcontroller6.phar.zip
Binary files 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
--- a/ext/phar/tests/zip/files/frontcontroller7.phar.zip
+++ b/ext/phar/tests/zip/files/frontcontroller7.phar.zip
Binary files 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
--- a/ext/phar/tests/zip/files/frontcontroller8.phar.zip
+++ b/ext/phar/tests/zip/files/frontcontroller8.phar.zip
Binary files 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
--- a/ext/phar/tests/zip/files/frontcontroller9.phar.zip
+++ b/ext/phar/tests/zip/files/frontcontroller9.phar.zip
Binary files differ