PHP :: Sec Bug #54238 :: use-after-free in substr_replace()
| Sec Bug #54238 | use-after-free in substr_replace() | ||||
|---|---|---|---|---|---|
| Submitted: | 2011-03-13 02:29 UTC | Modified: | 2011-04-13 08:34 UTC | ||
| From: | felipe@php.net | Assigned: | stas (profile) | ||
| Status: | Closed | Package: | Strings related | ||
| PHP Version: | Irrelevant | OS: | Linux | ||
| Private report: | No | CVE-ID: | 2011-1148 | ||
[2011-03-13 02:29 UTC] felipe@php.net
Description:
------------
Caused by passing the same variable multiple times to the function, which makes a convert_to_<type>_ex() call to invalid the each pointer of parameter.
Test script:
---------------
<?php
$f = array(array('A', 'A'));
$z = substr_replace($f, $f, $f, 1);
var_dump($z, $f);
Actual result:
--------------
array(1) {
[0]=>
string(5) "0Dd y"
}
array(1) {
[0]=>
string(1) "0"
}
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2011-04-13 08:33 UTC] stas@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: stas
[2011-04-13 08:33 UTC] stas@php.net