diff options
| author | Lauri Kenttä <lauri.kentta@gmail.com> | 2016-05-21 18:46:00 +0300 |
|---|---|---|
| committer | Lauri Kenttä <lauri.kentta@gmail.com> | 2016-05-21 18:46:00 +0300 |
| commit | 26fa27d760c7b119805ba6d9db624f479d9b9fc8 (patch) | |
| tree | f7e5aba6c75adac6cf40fe4ff613a2d55bcc46ce /Zend/zend_operators.c | |
| parent | 4f077aee836ad7d8335cf62629a8364bdf939db9 (diff) | |
| download | php-git-26fa27d760c7b119805ba6d9db624f479d9b9fc8.tar.gz | |
Fix bug #72221 (segfault, past-the-end access)
Diffstat (limited to 'Zend/zend_operators.c')
| -rw-r--r-- | Zend/zend_operators.c | 3 |
1 files changed, 3 insertions, 0 deletions
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])]; } |
