php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48641 tmpfile() uses old parameter parsing
Submitted: 2009-06-22 11:16 UTC Modified: 2009-06-22 11:38 UTC
From: crrodriguez at opensuse dot org Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 5.3CVS-2009-06-22 (CVS) OS: Irrelevant
Private report: No CVE-ID:
 [2009-06-22 11:16 UTC] crrodriguez at opensuse dot org
Description:
------------
tmpfile() still uses the old parameter parsing stuff..so an incomplete warning is issued when the function is called with parameters.


fix:



cvs diff: Diffing ext/standard
Index: ext/standard/file.c
===================================================================
RCS file: /repository/php-src/ext/standard/file.c,v
retrieving revision 1.409.2.6.2.28.2.35
diff -u -p -r1.409.2.6.2.28.2.35 file.c
--- ext/standard/file.c 24 May 2009 16:01:47 -0000      1.409.2.6.2.28.2.35
+++ ext/standard/file.c 22 Jun 2009 11:14:39 -0000
@@ -869,8 +869,8 @@ PHP_NAMED_FUNCTION(php_if_tmpfile)
 {
        php_stream *stream;

-       if (ZEND_NUM_ARGS() != 0) {
-               WRONG_PARAM_COUNT;
+       if (zend_parse_parameters_none() == FAILURE) {
+               return;
        }

        stream = php_stream_fopen_tmpfile();







Reproduce code:
---------------
php -r 'var_dump(tmpfile(0));'



Expected result:
----------------
Warning: tmpfile() expects exactly 0 parameters, 1 given in Command line code on line 1
NULL


Actual result:
--------------
Warning: Wrong parameter count for tmpfile() in Command line code on line 1
NULL


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-22 11:38 UTC] felipe@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 21:01:55 2014 UTC