diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 075d9fc5263b5..ef7a10d94ddb4 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -655,7 +655,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, bo } start_delimiter = delimiter; - if ((pp = strchr("([{< )]}>", delimiter))) + if ((pp = strchr("([{< )]}> )]}>", delimiter))) delimiter = pp[5]; end_delimiter = delimiter; diff --git a/ext/pcre/tests/oss-fuzz-65021.phpt b/ext/pcre/tests/oss-fuzz-65021.phpt new file mode 100644 index 0000000000000..38e1ebc1c7bc9 --- /dev/null +++ b/ext/pcre/tests/oss-fuzz-65021.phpt @@ -0,0 +1,11 @@ +--TEST-- +oss-fuzz #65021 +--FILE-- +","")); +var_dump(preg_match(">foo>i","FOO")); +?> +--EXPECTF-- +Warning: preg_match(): No ending delimiter '>' found in %s on line %d +bool(false) +int(1)