mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fixed bug #74873 (Minor BC break: PCRE_JIT changes output of preg_match()).
This commit is contained in:
parent
5a991ea49b
commit
29653da385
3 changed files with 16 additions and 0 deletions
4
NEWS
4
NEWS
|
@ -21,6 +21,10 @@ PHP NEWS
|
||||||
. Fixed bug #74651 (negative-size-param (-1) in memcpy in zif_openssl_seal()).
|
. Fixed bug #74651 (negative-size-param (-1) in memcpy in zif_openssl_seal()).
|
||||||
(Stas)
|
(Stas)
|
||||||
|
|
||||||
|
- PCRE:
|
||||||
|
. Fixed bug #74873 (Minor BC break: PCRE_JIT changes output of preg_match()).
|
||||||
|
(Dmitry)
|
||||||
|
|
||||||
06 Jul 2017, PHP 7.2.0alpha3
|
06 Jul 2017, PHP 7.2.0alpha3
|
||||||
|
|
||||||
- Core:
|
- Core:
|
||||||
|
|
|
@ -826,6 +826,10 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
|
||||||
#ifdef HAVE_PCRE_JIT_SUPPORT
|
#ifdef HAVE_PCRE_JIT_SUPPORT
|
||||||
if ((extra->flags & PCRE_EXTRA_EXECUTABLE_JIT)
|
if ((extra->flags & PCRE_EXTRA_EXECUTABLE_JIT)
|
||||||
&& no_utf_check && !g_notempty) {
|
&& 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,
|
count = pcre_jit_exec(pce->re, extra, subject, (int)subject_len, (int)start_offset,
|
||||||
no_utf_check|g_notempty, offsets, size_offsets, jit_stack);
|
no_utf_check|g_notempty, offsets, size_offsets, jit_stack);
|
||||||
} else
|
} else
|
||||||
|
|
8
ext/pcre/tests/bug74873.phpt
Normal file
8
ext/pcre/tests/bug74873.phpt
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #74873 (Minor BC break: PCRE_JIT changes output of preg_match())
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
var_dump(preg_match('/\S+/', 'foo bar', $matches, 0, 99999));
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
bool(false)
|
Loading…
Add table
Add a link
Reference in a new issue