mirror of
https://github.com/php/php-src.git
synced 2026-04-28 02:33:17 +02:00
aa553af911
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
13 lines
260 B
PHP
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)
|