mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
- Fixed bug #52573 (SplFileObject::fscanf Segmentation fault)
This commit is contained in:
parent
e0b728597b
commit
c10bb27254
2 changed files with 17 additions and 1 deletions
|
@ -1865,7 +1865,11 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function
|
||||||
|
|
||||||
result = zend_call_function(&fci, &fcic TSRMLS_CC);
|
result = zend_call_function(&fci, &fcic TSRMLS_CC);
|
||||||
|
|
||||||
ZVAL_ZVAL(return_value, retval, 1, 1);
|
if (result == FAILURE) {
|
||||||
|
RETVAL_FALSE;
|
||||||
|
} else {
|
||||||
|
ZVAL_ZVAL(return_value, retval, 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
efree(params);
|
efree(params);
|
||||||
return result;
|
return result;
|
||||||
|
|
12
ext/spl/tests/bug52573.phpt
Normal file
12
ext/spl/tests/bug52573.phpt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #52573 (SplFileObject::fscanf Segmentation fault)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$result = null;
|
||||||
|
$f = new SplFileObject(__FILE__, 'r');
|
||||||
|
$f->fscanf('<?php // %s', $result);
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
Warning: Parameter 3 to fscanf() expected to be a reference, value given in %s on line 5
|
Loading…
Add table
Add a link
Reference in a new issue