|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-04-18 23:31 UTC] phpbug at kartio dot org
Description:
------------
Will crash on some character sequences that are not valid unicode. Trying to print same character with valid utf-8 sequence doesn't crash.
Test script:
---------------
yaml_emit("\xc2");
Actual result:
--------------
PHP Warning: yaml_emit(): Memory error: Not enough memory for creating an event (libyaml) in php shell code on line 1
*** glibc detected *** /usr/bin/php: double free or corruption (fasttop): 0x09537278 ***
======= Backtrace: =========
/lib/i686/cmov/libc.so.6(+0x6b381)[0xb6f4a381]
/lib/i686/cmov/libc.so.6(+0x6cbd8)[0xb6f4bbd8]
/lib/i686/cmov/libc.so.6(cfree+0x6d)[0xb6f4ecbd]
/usr/lib/libyaml-0.so.2(yaml_free+0x21)[0xb6316631]
/usr/lib/libyaml-0.so.2(yaml_event_delete+0x9e)[0xb631687e]
/usr/lib/php5/20090626+lfs/yaml.so(+0x5c05)[0xb6336c05]
/usr/lib/php5/20090626+lfs/yaml.so(+0x62f8)[0xb63372f8]
/usr/lib/php5/20090626+lfs/yaml.so(+0x664b)[0xb633764b]
/usr/lib/php5/20090626+lfs/yaml.so(php_yaml_write_impl+0x12e)[0xb6337b8e]
/usr/lib/php5/20090626+lfs/yaml.so(+0x26e4)[0xb63336e4]
/usr/bin/php(execute_internal+0x4b)[0x8364f5b]
...
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 08:00:02 2025 UTC |
Crashing just because the upstream library has a bug isn't acceptable. I need to fix this. Behavior similar to json_encode() for the same input would be acceptable: $ php -r 'var_dump(json_encode("\xc2"));' PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in Command line code on line 1 string(4) "null"