#40943 [Fbk->Opn]: Function str_ireplace() crashes Apache server
| From: | dzoukr at dzoukr dot cz | Date: | Thu, 29 Mar 2007 09:20:44 +0000 |
| Subject: | #40943 [Fbk->Opn]: Function str_ireplace() crashes Apache server | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-110912@lists.php.net to get a copy of this message | ||
ID: 40943
User updated by: dzoukr at dzoukr dot cz
Reported By: dzoukr at dzoukr dot cz
-Status: Feedback
+Status: Open
Bug Type: Reproducible crash
Operating System: Windows XP SP2
PHP Version: 5.2.1
New Comment:
OK. Anyway, thanks for looking at it. Maybe it is some crazy
combination of Apache settings and PHP. ;) As I said - I`m using Wamp
server and I made almost no configuration changes, so who knows. Now I`m
using str_replace() and no problem occured.
Previous Comments:
------------------------------------------------------------------------
[2007-03-29 08:32:05] tony2001@php.net
Btw, I can't replicate anything like that both in the snapshot and
5.2.1.
------------------------------------------------------------------------
[2007-03-29 08:28:46] tony2001@php.net
You can expect it to be fixed in the snapshot.
To install it just download the .zip and unpack it.
------------------------------------------------------------------------
[2007-03-29 08:25:50] dzoukr at dzoukr dot cz
Ok, I will try it asap. But I have to find out first, how to re-install
PHP on Wamp server (this is bundle of PHP+MySQL+Apache2). ;-) Can I
expect this bug will be fixed in next PHP stable release version?
------------------------------------------------------------------------
[2007-03-29 08:14:47] tony2001@php.net
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
------------------------------------------------------------------------
[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