Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix concat_function use-after-free on out-of-memory error (#11297)
Introduced by GH-10049
- Loading branch information
Showing
2 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--TEST-- | ||
Bug #79836 (use-after-free in concat_function) | ||
--INI-- | ||
memory_limit=10M | ||
--FILE-- | ||
<?php | ||
class Foo { | ||
public function __toString() { | ||
return str_repeat('a', 10); | ||
} | ||
} | ||
|
||
$i = str_repeat('a', 5 * 1024 * 1024); | ||
$e = new Foo(); | ||
$e .= $i; | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters