diff options
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 |