Fixed #46051 (SplFileInfo::openFile - memory overlap)

This commit is contained in:
Arnaud Le Blanc 2008-09-11 15:22:17 +00:00
parent 5f50350ca9
commit f327994df3
2 changed files with 15 additions and 0 deletions

View File

@ -533,6 +533,7 @@ static spl_filesystem_object * spl_filesystem_object_create_type(int ht, spl_fil
&use_include_path, &intern->u.file.zcontext) == FAILURE) {
zend_restore_error_handling(&error_handling TSRMLS_CC);
intern->u.file.open_mode = NULL;
intern->file_name.v = NULL;
zval_dtor(return_value);
Z_TYPE_P(return_value) = IS_NULL;
return NULL;

View File

@ -0,0 +1,14 @@
--TEST--
Bug #46051 (SplFileInfo::openFile - memory overlap)
--FILE--
<?php
$x = new splfileinfo(__FILE__);
try {
$x->openFile(NULL, NULL, NULL);
} catch (Exception $e) { }
var_dump($x->getPathName());
--EXPECTF--
%unicode|string%(%d) "%sbug46051.php"