com php-src: Fix bug #72221 (segfault, past-the-end access): Zend/zend_operators.c
| From: | Xinchen Hui | Date: | Sat, 28 May 2016 08:10:16 +0000 |
| Subject: | com php-src: Fix bug #72221 (segfault, past-the-end access): Zend/zend_operators.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-92228@lists.php.net to get a copy of this message | ||
Commit: 287f9489d840f0e2c192c8db9fe69f7b03bb8af5
Author: Lauri Kenttä <lauri.kentta@gmail.com> Sat, 21 May 2016 18:46:00 +0300
Committer: Xinchen Hui <laruence@gmail.com> Sat, 28 May 2016 16:10:16 +0800
Parents: cc0d23766481086cb2ff7cf605201db18775b79b
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=287f9489d840f0e2c192c8db9fe69f7b03bb8af5
Log:
Fix bug #72221 (segfault, past-the-end access)
Bugs:
https://bugs.php.net/72221
Changed paths:
M Zend/zend_operators.c
Diff:
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 50557e5..a02551b 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])];
}