1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00
Files
archived-php-src/ext/mbstring/tests/gh11217.phpt
T
Ilija Tovilo aa553af911 Fix segfault in mb_strrpos/mb_strripos with ASCII encoding and negative offset
We're setting the encoding from PHP_FUNCTION(mb_strpos), but mbfl_strpos would
discard it, setting it to mbfl_encoding_pass, making zend_memnrstr fail due to a
null-pointer exception.

Fixes GH-11217
Closes GH-11220
2023-05-15 10:36:37 +02:00

13 lines
260 B
PHP

--TEST--
GH-11217: Segfault in mb_strrpos/mb_strripos with ASCII encoding and negative offset
--EXTENSIONS--
mbstring
--FILE--
<?php
var_dump(mb_strrpos('foo', 'foo', -1, 'ASCII'));
var_dump(mb_strripos('foo', 'foo', -1, 'ASCII'));
?>
--EXPECT--
int(0)
int(0)