summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi Collet <rcollet@redhat.com>2014-08-14 17:19:03 -0700
committerStanislav Malyshev <stas@php.net>2014-08-14 17:44:19 -0700
commit7ba1409a1aee5925180de546057ddd84ff267947 (patch)
treeb38effde85b6019f38e4397f0be896c1e148f17b
parentfd28010e20ae051e84884232c550c5ec428f632e (diff)
downloadphp-git-7ba1409a1aee5925180de546057ddd84ff267947.tar.gz
Fix bug #67716 - Segfault in cdf.c
-rw-r--r--NEWS1
-rw-r--r--ext/fileinfo/libmagic/cdf.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 473f96a35e..9805a719d3 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ PHP NEWS
- Fileinfo:
. Fixed bug #67705 (extensive backtracking in rule regular expression).
(CVE-2014-3538) (Remi)
+ . Fixed bug #67716 (Segfault in cdf.c). (CVE-2014-3587) (Remi)
- GD:
. Fixed bug #66901 (php-gd 'c_color' NULL pointer dereference).
diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c
index 429f3b952f..2c0a2d9dfc 100644
--- a/ext/fileinfo/libmagic/cdf.c
+++ b/ext/fileinfo/libmagic/cdf.c
@@ -820,7 +820,7 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
q = (const uint8_t *)(const void *)
((const char *)(const void *)p + ofs
- 2 * sizeof(uint32_t));
- if (q > e) {
+ if (q < p || q > e) {
DPRINTF(("Ran of the end %p > %p\n", q, e));
goto out;
}