mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix GH-16189: underflow on preg_match/preg_match_all start_offset.
close GH-16191
This commit is contained in:
parent
f14e5cfaaa
commit
f453d1ae2a
3 changed files with 27 additions and 0 deletions
|
@ -1135,6 +1135,11 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ *
|
|||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (start_offset == ZEND_LONG_MIN) {
|
||||
zend_argument_value_error(5, "must be greater than " ZEND_LONG_FMT, ZEND_LONG_MIN);
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
pce->refcount++;
|
||||
php_pcre_match_impl(pce, subject, return_value, subpats,
|
||||
global, ZEND_NUM_ARGS() >= 4, flags, start_offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue