php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45722 mb_check_encoding() crashes
Submitted: 2008-08-05 11:51 UTC Modified: 2008-10-16 01:06 UTC
From: estacuentanolamiro at gmail dot com Assigned: moriyoshi (profile)
Status: Closed Package: mbstring related
PHP Version: 5.2CVS, 5.3CVS, 6CVS (2008-08-05) OS: *
Private report: No CVE-ID: None
 [2008-08-05 11:51 UTC] estacuentanolamiro at gmail dot com
Description:
------------
mb_check_encoding segmentation fault



Reproduce code:
---------------
$text = "&? ASDF ASDF ASDF ASDF ASDF ASDF ASDF";
if( mb_check_encoding($text,'HTML-ENTITIES') ) {
     $text = htmlentities($text);
}
echo $text;

Expected result:
----------------
string

Actual result:
--------------
Nothing, segmentation fault.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-05 11:54 UTC] estacuentanolamiro at gmail dot com
Sorry, correct reproduce code:

$text = "&? ASDF ASDF ASDF ASDF ASDF ASDF ASDF";
if( !mb_check_encoding($text,'HTML-ENTITIES') ) {
     $text = htmlentities($text);
}
echo $text;
 [2008-08-05 12:13 UTC] jani@php.net
Moriyoshi, verified with all branches. 
 [2008-10-16 01:06 UTC] moriyoshi@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 10:01:29 2024 UTC