felipe                                   Tue, 10 Aug 2010 22:37:24 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=302085

Log:
- Fixed bug #52573 (SplFileObject::fscanf Segmentation fault)

Bug: http://bugs.php.net/52573 (Open) SplFileObject::fscanf  Segmentation fault
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c
    A   php/php-src/branches/PHP_5_3/ext/spl/tests/bug52573.phpt
    U   php/php-src/trunk/ext/spl/spl_directory.c
    A   php/php-src/trunk/ext/spl/tests/bug52573.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2010-08-10 21:52:14 UTC (rev 302084)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-08-10 22:37:24 UTC (rev 302085)
@@ -1,6 +1,7 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2010, PHP 5.3.4
+- Fixed bug #52573 (SplFileObject::fscanf Segmentation fault). (Felipe)
 - Fixed bug #52546 (pdo_dblib segmentation fault when iterating MONEY values).
   (Felipe)
 - Fixed bug #52534 (var_export array with negative key). (Felipe)

Modified: php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c        2010-08-10 
21:52:14 UTC (rev 302084)
+++ php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c        2010-08-10 
22:37:24 UTC (rev 302085)
@@ -1862,7 +1862,11 @@

        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);
        return result;

Added: php/php-src/branches/PHP_5_3/ext/spl/tests/bug52573.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/spl/tests/bug52573.phpt                    
        (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/spl/tests/bug52573.phpt    2010-08-10 
22:37:24 UTC (rev 302085)
@@ -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


Property changes on: php/php-src/branches/PHP_5_3/ext/spl/tests/bug52573.phpt
___________________________________________________________________
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/trunk/ext/spl/spl_directory.c
===================================================================
--- php/php-src/trunk/ext/spl/spl_directory.c   2010-08-10 21:52:14 UTC (rev 
302084)
+++ php/php-src/trunk/ext/spl/spl_directory.c   2010-08-10 22:37:24 UTC (rev 
302085)
@@ -1865,7 +1865,11 @@

        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);
        return result;

Added: php/php-src/trunk/ext/spl/tests/bug52573.phpt
===================================================================
--- php/php-src/trunk/ext/spl/tests/bug52573.phpt                               
(rev 0)
+++ php/php-src/trunk/ext/spl/tests/bug52573.phpt       2010-08-10 22:37:24 UTC 
(rev 302085)
@@ -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


Property changes on: php/php-src/trunk/ext/spl/tests/bug52573.phpt
___________________________________________________________________
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to