Bug #79951 [Asn->Csd]: Memory leak in str_replace of empty string
| From: | nikic@php.net | Date: | Tue, 11 Aug 2020 08:37:10 +0000 |
| Subject: | Bug #79951 [Asn->Csd]: Memory leak in str_replace of empty string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-228502@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79951&edit=1
ID: 79951
Updated by: nikic@php.net
Reported by: changochen1 at gmail dot com
Summary: Memory leak in str_replace of empty string
-Status: Assigned
+Status: Closed
Type: Bug
Package: Scripting Engine problem
PHP Version: 8.0Git-2020-08-10 (Git)
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=9d9dffe60aee0fb469ee0d414eca2a5033a7eafc
Log: Fixed bug #79951
Previous Comments:
------------------------------------------------------------------------
[2020-08-11 08:26:43] nikic@php.net
Reduced:
<?php
str_replace([""], [1000], "foo");
------------------------------------------------------------------------
[2020-08-11 07:15:55] sjon@php.net
this seems to have been fixed in 8.0alpha3 already, see https://3v4l.org/2vhhJ#v800alpha1
------------------------------------------------------------------------
[2020-08-10 22:31:32] changochen1 at gmail dot com
Description:
------------
We found a memory leak in PHP. Please refer to the POC.
Test script:
---------------
<?
$a = array ( 4 , 1 , $a , 1 , 1.500000 , 7 , false , 'x' , 'x' , 500 ) ;
foreach ( $a as $b ) str_replace ( $GLOBALS , $a , $a ) ;
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79951&edit=1