#37113 [Bgs]: Malicious Memory Management(?)
| From: | oliver dot block at lycos dot de | Date: | Tue, 18 Apr 2006 00:02:46 +0000 |
| Subject: | #37113 [Bgs]: Malicious Memory Management(?) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-95909@lists.php.net to get a copy of this message | ||
ID: 37113
User updated by: oliver dot block at lycos dot de
Reported By: oliver dot block at lycos dot de
Status: Bogus
Bug Type: PCRE related
Operating System: Unix
PHP Version: 5.1.2
New Comment:
But it does not return $match[7] which might contain GMT
but _not_ (GMT).
Previous Comments:
------------------------------------------------------------------------
[2006-04-17 22:59:43] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Your regex fetches the GMT, so where is the problem.
------------------------------------------------------------------------
[2006-04-17 21:08:55] oliver dot block at lycos dot de
Description:
------------
preg_replace_callback returns content that should not be in memory!
Reproduce code:
---------------
input:
1. "Tue, 11 Apr 2006 17:09:22 GMT"
2. "Tue, 11 Apr 2006 20:26:57 +0000 (GMT)"
3. ""
function check_date($s)
{
$muster = "/(Mon, |Tue, |Wed, |Thu, |Fri, |Sat, |Sun, )?(\d\d?)
(.{3})
(\d\d\d\d) (\d\d:\d\d(:\d\d)?) (([+-](\d\d(\d\d)))|GMT)/";
$result = "";
$result = preg_replace_callback($muster, create_function('$match',
'$mon = array("Jan" => "01", "Feb" =>
"02", "Mar" =>
"03",
"Apr" => "04", "May" =>
"05", "Jun" =>
"06",
"Jul" => "07", "Aug" =>
"08", "Sep" =>
"09",
"Okt" => "10", "Nov" =>
"11", "Dez" =>
"12");
$mm = $mon[$match[3]];
return "{$match[2]}.{$mm}.{$match[4]}";
'),
$s);
return $result;
}
Expected result:
----------------
1. "11.04.2006"
2. "11.04.2006"
3. ""
Actual result:
--------------
1. "11.04.2006"
2. "11.04.2006 (GMT)"
3. ""
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37113&edit=1