From 2fb2f81538704fc6c09173e3843f22aa6b3d04fc Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Wed, 18 Aug 2010 01:59:37 +0000 Subject: [PATCH] - Improved fix for bug #52573 --- Zend/zend_compile.c | 3 ++- ext/spl/spl_directory.c | 2 +- ext/spl/tests/bug52573.phpt | 14 ++++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 0ccacbb27df..febf2da905c 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2551,7 +2551,8 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c return 0; } - if (proto->common.pass_rest_by_reference + if (fe->common.type != ZEND_USER_FUNCTION + && proto->common.pass_rest_by_reference && !fe->common.pass_rest_by_reference) { return 0; } diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 1c21a53ec3c..5a3bd48ea5b 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 17f2984dfb0..54587fae1da 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-- -fscanf('fscanf('fscanf(' --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 +}