[php-src] Issue #20832: mbstring: assertion failure in mb_wchar_to_sjismac with MacJapanese encoding

From: Date: Sun, 04 Jan 2026 14:22:30 +0000
Subject: [php-src] Issue #20832: mbstring: assertion failure in mb_wchar_to_sjismac with MacJapanese encoding
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-251475@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/20832 Author: vi3tL0u1s ### Description The following code: ```php <?php class Test { public function __get($var) { if (true) { $var= $ar; $this->{$var}!=print bin2hex(mb_substr("abc\n85xx\x85\xAC\x85\xAD", -2, $test->t1, 'MacJapanese')); } } } $test = new Test; $test->teht; ``` Resulted in this output: ``` php: /path/to/php-src/ext/mbstring/libmbfl/filters/mbfilter_cjk.c:5675: mb_wchar_to_sjismac: Assertion `out <= limit' failed. Aborted ``` ### Commit ``` cb63e4f998b ``` ### Configurations ```bash CC="clang" CXX="clang++" CFLAGS="-fsanitize=address -g -O0" CXXFLAGS="-fsanitize=address -g -O0" ./configure --enable-debug --enable-address-sanitizer --disable-shared --with-pic ``` ### PHP Version ```plain PHP 8.6.0-dev (cli) (built: Jan 5 2026 01:08:08) (NTS DEBUG) Copyright (c) The PHP Group Zend Engine v4.6.0-dev, Copyright (c) Zend Technologies with Zend OPcache v8.6.0-dev, Copyright (c), by Zend Technologies ``` ### Operating System Ubuntu 22.04

« previous php.bugs (#251475) next »