summaryrefslogtreecommitdiff
path: root/Zend/zend_operators.c
diff options
context:
space:
mode:
authorLauri Kenttä <lauri.kentta@gmail.com>2016-05-21 18:46:00 +0300
committerXinchen Hui <laruence@gmail.com>2016-05-28 16:10:16 +0800
commit287f9489d840f0e2c192c8db9fe69f7b03bb8af5 (patch)
tree68e89d252079238643868987a2df7cac87ceb5e7 /Zend/zend_operators.c
parentcc0d23766481086cb2ff7cf605201db18775b79b (diff)
downloadphp-git-287f9489d840f0e2c192c8db9fe69f7b03bb8af5.tar.gz
Fix bug #72221 (segfault, past-the-end access)
Diffstat (limited to 'Zend/zend_operators.c')
-rw-r--r--Zend/zend_operators.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 50557e56d8..a02551b1bd 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -2927,6 +2927,9 @@ ZEND_API const char* ZEND_FASTCALL zend_memnstr_ex(const char *haystack, const c
if (i == needle_len) {
return p;
}
+ if (UNEXPECTED(p == end)) {
+ return NULL;
+ }
p += td[(unsigned char)(p[needle_len])];
}