ID: 40004
User updated by: php at koterov dot ru
Reported By: php at koterov dot ru
Status: Open
Bug Type: PCRE related
Operating System: Windows XP
PHP Version: 4.4.4
New Comment:
This is also reproducible in command-line php.exe
PHP 4.4.4
PHP 5.1.6 (!)
Cannot reproduce on PHP 5.2.0.
Previous Comments:
------------------------------------------------------------------------
[2007-01-03 00:10:57] php at koterov dot ru
Description:
------------
Seems preg_match with /u modifier corrupts process memory or returns
pointer to nirvana instead of pointer to a string.
Reproduce code:
---------------
<?
preg_match('/(.{0,20})$/us', " ", $m);
var_export($m);
?>
Expected result:
----------------
space
Actual result:
--------------
something like
array (
0 => ' kjwekwjn',
1 => ' wereinoiu',
)
where "kjwekwjn" and "wereinoiu" are random strings with random binary
data (useless to copy-paste them here).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40004&edit=1