summaryrefslogtreecommitdiffstats
path: root/bug71498.patch
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-03-02 16:38:54 +0100
committerRemi Collet <fedora@famillecollet.com>2016-03-02 16:38:54 +0100
commit1c9b27afad1181e4a57cb0e1b60f728090c052db (patch)
treed0bd373a4785e66f0ea976f38f57679c9a0b8ec4 /bug71498.patch
parent1ed943ec556f4bfa49a2700b30c9bb58a91379eb (diff)
PHP 5.4.45 with security patches from 5.5.33
Diffstat (limited to 'bug71498.patch')
-rw-r--r--bug71498.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/bug71498.patch b/bug71498.patch
new file mode 100644
index 0000000..d4977e7
--- /dev/null
+++ b/bug71498.patch
@@ -0,0 +1,31 @@
+Backported from 5.5 for 5.4 by Remi Collet
+binary patch dropped
+
+From a6fdc5bb27b20d889de0cd29318b3968aabb57bd Mon Sep 17 00:00:00 2001
+From: Stanislav Malyshev <stas@php.net>
+Date: Sun, 21 Feb 2016 16:51:05 -0800
+Subject: [PATCH] Fix bug #71498: Out-of-Bound Read in phar_parse_zipfile()
+
+---
+ ext/phar/tests/bug71488.phpt | 1 +
+ ext/phar/tests/bug71498.phpt | 17 +++++++++++++++++
+ ext/phar/tests/bug71498.zip | Bin 0 -> 65677 bytes
+ ext/phar/zip.c | 6 +++---
+ 4 files changed, 21 insertions(+), 3 deletions(-)
+ create mode 100644 ext/phar/tests/bug71498.phpt
+ create mode 100644 ext/phar/tests/bug71498.zip
+
+diff --git a/ext/phar/zip.c b/ext/phar/zip.c
+index e4883d3..7f294c2 100644
+--- a/ext/phar/zip.c
++++ b/ext/phar/zip.c
+@@ -199,7 +199,7 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias,
+ }
+
+ while ((p=(char *) memchr(p + 1, 'P', (size_t) (size - (p + 1 - buf)))) != NULL) {
+- if (!memcmp(p + 1, "K\5\6", 3)) {
++ if ((p - buf) + sizeof(locator) <= size && !memcmp(p + 1, "K\5\6", 3)) {
+ memcpy((void *)&locator, (void *) p, sizeof(locator));
+ if (PHAR_GET_16(locator.centraldisk) != 0 || PHAR_GET_16(locator.disknumber) != 0) {
+ /* split archives not handled */
+