#40943 [Opn->Fbk]: Function str_ireplace() crashes Apache server
| From: | tony2001@php.net | Date: | Thu, 29 Mar 2007 08:14:47 +0000 |
| Subject: | #40943 [Opn->Fbk]: Function str_ireplace() crashes Apache server | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-110907@lists.php.net to get a copy of this message | ||
ID: 40943
Updated by: tony2001@php.net
Reported By: dzoukr at dzoukr dot cz
-Status: Open
+Status: Feedback
Bug Type: Reproducible crash
Operating System: Windows XP SP2
PHP Version: 5.2.1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2007-03-29 06:52:45] dzoukr at dzoukr dot cz
Description:
------------
Hi guys, yesterday I found a bug, which has been making me mad for a
long time. I found out that function str_ireplace() in current version
(5.2.1) on Apache2 (WinXP SP2) crashes server. I looked in release log,
where is something about buffer overflow for str_replace(), but it seems
that function str_ireplace() has been forgotten. It happens on
multi-using this function.
Reproduce code:
---------------
<?php
$string = "not so long text, maybe less than 1000 chars";
$result = str_ireplace("A", "B", $string);
$result = str_ireplace("B", "C", $result);
$result = str_ireplace("C", "D", $result);
$result = str_ireplace("D", "E", $result);
$result = str_ireplace("E", "F", $result);
?>
Expected result:
----------------
String with replaced chars
Actual result:
--------------
Apache crashes - browser says, that connection with server has been
corrupted during page loading!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40943&edit=1