diff options
| author | Felipe Pena <felipe@php.net> | 2010-08-18 01:59:37 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2010-08-18 01:59:37 +0000 |
| commit | 2fb2f81538704fc6c09173e3843f22aa6b3d04fc (patch) | |
| tree | 412f729341c3c096360059dc293d36c67285b09b /ext | |
| parent | ed806c44613ca233d17f32e1513df7a7a4fd82bc (diff) | |
| download | php-git-2fb2f81538704fc6c09173e3843f22aa6b3d04fc.tar.gz | |
- Improved fix for bug #52573
Diffstat (limited to 'ext')
| -rwxr-xr-x | ext/spl/spl_directory.c | 2 | ||||
| -rw-r--r-- | ext/spl/tests/bug52573.phpt | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 1c21a53ec3..5a3bd48ea5 100755 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -2583,7 +2583,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fgetss, 0, 0, 0) ZEND_ARG_INFO(0, allowable_tags) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fscanf, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fscanf, 1, 0, 1) ZEND_ARG_INFO(0, format) ZEND_END_ARG_INFO() diff --git a/ext/spl/tests/bug52573.phpt b/ext/spl/tests/bug52573.phpt index 17f2984dfb..54587fae1d 100644 --- a/ext/spl/tests/bug52573.phpt +++ b/ext/spl/tests/bug52573.phpt @@ -1,12 +1,18 @@ --TEST-- Bug #52573 (SplFileObject::fscanf Segmentation fault) --FILE-- -<?php +<?php // test $result = null; $f = new SplFileObject(__FILE__, 'r'); -$f->fscanf('<?php // %s', $result); - +var_dump($f->fscanf('<?php // %s', $result)); +var_dump($result); +var_dump($f->fscanf('<?php // %s')); ?> --EXPECTF-- -Warning: Parameter 3 to fscanf() expected to be a reference, value given in %s on line 5 +int(1) +string(4) "test" +array(1) { + [0]=> + NULL +} |
