diff options
author | Dmitry Stogov <dmitry@zend.com> | 2017-07-07 09:54:21 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2017-07-07 09:54:21 +0300 |
commit | 29653da385f89dcf00ebbb6823a395e1484d4dc3 (patch) | |
tree | 99436d668c7bc2bcd4b8a241d7e09516ac046418 /ext/pcre/php_pcre.c | |
parent | 5a991ea49b1accf766e0044e10a3712fe0399a27 (diff) | |
download | php-git-29653da385f89dcf00ebbb6823a395e1484d4dc3.tar.gz |
Fixed bug #74873 (Minor BC break: PCRE_JIT changes output of preg_match()).
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r-- | ext/pcre/php_pcre.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 5b07951c63..9779afaa36 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -826,6 +826,10 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec #ifdef HAVE_PCRE_JIT_SUPPORT if ((extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) && no_utf_check && !g_notempty) { + if (start_offset < 0 || start_offset > subject_len) { + pcre_handle_exec_error(PCRE_ERROR_BADOFFSET); + break; + } count = pcre_jit_exec(pce->re, extra, subject, (int)subject_len, (int)start_offset, no_utf_check|g_notempty, offsets, size_offsets, jit_stack); } else |