summaryrefslogtreecommitdiffstats
path: root/bug69720.patch
diff options
context:
space:
mode:
Diffstat (limited to 'bug69720.patch')
-rw-r--r--bug69720.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/bug69720.patch b/bug69720.patch
new file mode 100644
index 0000000..bfcd058
--- /dev/null
+++ b/bug69720.patch
@@ -0,0 +1,62 @@
+Backported from 5.5 for 5.4
+binary patch dropped
+
+
+From d698f0ae51f67c9cce870b09c59df3d6ba959244 Mon Sep 17 00:00:00 2001
+From: Stanislav Malyshev <stas@php.net>
+Date: Mon, 28 Sep 2015 15:51:59 -0700
+Subject: [PATCH] Fix bug #69720: Null pointer dereference in
+ phar_get_fp_offset()
+
+---
+ ext/phar/tests/bug69720.phar | Bin 0 -> 8192 bytes
+ ext/phar/tests/bug69720.phpt | 40 ++++++++++++++++++++++++++++++++++++++++
+ ext/phar/util.c | 6 +++++-
+ 3 files changed, 45 insertions(+), 1 deletion(-)
+ create mode 100644 ext/phar/tests/bug69720.phar
+ create mode 100644 ext/phar/tests/bug69720.phpt
+
+diff --git a/ext/phar/util.c b/ext/phar/util.c
+index 2c41adf..69da7b9 100644
+--- a/ext/phar/util.c
++++ b/ext/phar/util.c
+@@ -716,7 +716,11 @@ really_get_entry:
+ (*ret)->is_tar = entry->is_tar;
+ (*ret)->fp = phar_get_efp(entry, 1 TSRMLS_CC);
+ if (entry->link) {
+- (*ret)->zero = phar_get_fp_offset(phar_get_link_source(entry TSRMLS_CC) TSRMLS_CC);
++ phar_entry_info *link = phar_get_link_source(entry TSRMLS_CC);
++ if(!link) {
++ return FAILURE;
++ }
++ (*ret)->zero = phar_get_fp_offset(link TSRMLS_CC);
+ } else {
+ (*ret)->zero = phar_get_fp_offset(entry TSRMLS_CC);
+ }
+--
+2.1.4
+
+From f98ab19dc0c978e3caaa2614579e4a61f2c317f5 Mon Sep 17 00:00:00 2001
+From: Stanislav Malyshev <stas@php.net>
+Date: Mon, 28 Sep 2015 20:43:18 -0700
+Subject: [PATCH] fix memory leak
+
+---
+ ext/phar/util.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/ext/phar/util.c b/ext/phar/util.c
+index 69da7b9..e7decda 100644
+--- a/ext/phar/util.c
++++ b/ext/phar/util.c
+@@ -718,6 +718,7 @@ really_get_entry:
+ if (entry->link) {
+ phar_entry_info *link = phar_get_link_source(entry TSRMLS_CC);
+ if(!link) {
++ efree(*ret);
+ return FAILURE;
+ }
+ (*ret)->zero = phar_get_fp_offset(link TSRMLS_CC);
+--
+2.1.4
+