Crash when using getRealPath with DirectoryIterator
| Bug #42364 | Crash when using getRealPath with DirectoryIterator | ||||
|---|---|---|---|---|---|
| Submitted: | 2007-08-21 17:15 UTC | Modified: | 2007-08-21 22:47 UTC | ||
| From: | kfou at free dot fr | Assigned: | |||
| Status: | Closed | Package: | Reproducible crash | ||
| PHP Version: | 5.2.4RC3-dev | OS: | Windows and Linux | ||
| Private report: | No | CVE-ID: | None | ||
[2007-08-21 17:15 UTC] kfou at free dot fr
Description:
------------
Calling getRealPath on an DirectoryIterator make PHP crash,
getPath works fine.
The problem also happens with php 5.2.3
Reproduce code:
---------------
<?php
$it = new DirectoryIterator("/tmp");
foreach ($it as $e)
{
$path = $e->getRealPath();
}
?>
Actual result:
--------------
(gdb) run test.php
Starting program: /home/wwwdev/php/bin/php test.php
Failed to read a valid object file image from memory.
Program received signal SIGSEGV, Segmentation fault.
tsrm_realpath (path=0x0, real_path=0xbfb0f20c "6?\025\b\001")
at /home/wwwdev/php5.2-200708201630/TSRM/tsrm_virtual_cwd.c:1266
1266 if (!*path) {
(gdb) bt
#0 tsrm_realpath (path=0x0, real_path=0xbfb0f20c "6?\025\b\001")
at /home/wwwdev/php5.2-200708201630/TSRM/tsrm_virtual_cwd.c:1266
#1 0x080a1c8c in zim_spl_SplFileInfo_getRealPath (ht=0, return_value=0xb7d0519c,
return_value_ptr=0x0, this_ptr=0xb7d04598, return_value_used=1)
at /home/wwwdev/php5.2-200708201630/ext/spl/spl_directory.c:861
#2 0x08175cc2 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfb103e0)
at /home/wwwdev/php5.2-200708201630/Zend/zend_vm_execute.h:202
#3 0x08174b58 in execute (op_array=0xb7d04a40)
at /home/wwwdev/php5.2-200708201630/Zend/zend_vm_execute.h:94
#4 0x081575f4 in zend_execute_scripts (type=8, retval=<value optimized out>,
file_count=3) at /home/wwwdev/php5.2-200708201630/Zend/zend.c:1134
#5 0x08117c00 in php_execute_script (primary_file=0xbfb1279c)
at /home/wwwdev/php5.2-200708201630/main/main.c:1982
#6 0x081d1674 in main (argc=2, argv=0xbfb128a4)
at /home/wwwdev/php5.2-200708201630/sapi/cli/php_cli.c:1140
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2007-08-21 19:02 UTC] kfou at free dot fr
[2007-08-21 22:47 UTC] johannes@php.net