Bug #76319 [NEW]: mb_strtolower with default encoding causes BufferOverflow and termination

From: Date: Wed, 09 May 2018 18:44:27 +0000
Subject: Bug #76319 [NEW]: mb_strtolower with default encoding causes BufferOverflow and termination
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215181@lists.php.net to get a copy of this message
From: ion dot bazan at gmail dot com Operating system: Linux PHP version: master-Git-2018-05-09 (Git) Package: *General Issues Bug Type: Bug Bug description:mb_strtolower with default encoding causes BufferOverflow and termination Description: ------------ Calling mb_strtolower without specifying the encoding may cause unexpected buffer overflow while on PHP 7.2 it works properly. Test script: --------------- var_dump(mb_strtolower(urldecode('a%A1%C0b'))); Expected result: ---------------- string(4) "a??b" Actual result: -------------- *** buffer overflow detected ***: php terminated ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x7329f)[0x7f3bc3f2f29f] /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7f3bc3fca83c] /lib/x86_64-linux-gnu/libc.so.6(+0x10d710)[0x7f3bc3fc9710] php[0x6f8f6d] php[0x6e8031] php(php_unicode_convert_case+0xbd)[0x6f917d] php[0x6f26c3] php(execute_ex+0x8e25)[0x9d15e5] php(zend_call_function+0x7de)[0x92533e] php[0x76fdba] php(execute_ex+0x8e25)[0x9d15e5] php(zend_execute+0x1d6)[0x9d26c6] php(zend_execute_scripts+0xe7)[0x9366f7] php(php_execute_script+0x3a6)[0x8c7116] php[0x9d4cda] php[0x45e8d0] --- CUT --- -- Edit bug report at https://bugs.php.net/bug.php?id=76319&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76319&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76319&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76319&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76319&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76319&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76319&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76319&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76319&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76319&r=support Expected behavior: https://bugs.php.net/fix.php?id=76319&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76319&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76319&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76319&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76319&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76319&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76319&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76319&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76319&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76319&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76319&r=mysqlcfg

« previous php.bugs (#215181) next »