mirror of
https://github.com/php/php-src.git
synced 2025-01-10 21:14:37 +08:00
Fixed #46051 (SplFileInfo::openFile - memory overlap)
This commit is contained in:
parent
5f50350ca9
commit
f327994df3
@ -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;
|
||||
|
14
ext/spl/tests/bug46051.phpt
Normal file
14
ext/spl/tests/bug46051.phpt
Normal 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"
|
Loading…
Reference in New Issue
Block a user