From 26fa27d760c7b119805ba6d9db624f479d9b9fc8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lauri=20Kentt=C3=A4?= Date: Sat, 21 May 2016 18:46:00 +0300 Subject: [PATCH] Fix bug #72221 (segfault, past-the-end access) --- Zend/zend_operators.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index f47a148564..8eb9a7b637 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -2965,6 +2965,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])]; } -- 2.50.1