|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-03-29 06:52 UTC] 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!
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 16:00:01 2025 UTC |
I've experienced the same problem on a production server of a customer, quiet annoying, even using str_replace instead will correct the problem The server reported : ERROR The requested URL could not be retrieved While trying to retrieve the URL: The following error was encountered: * Zero Sized Reply Server used is a Unix with PHP 5.2.1-0.dotdeb.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 9 2007 04:46:32)