php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68260 SQLite3Result::fetchArray declares wrong required_num_args
Submitted: 2014-10-18 21:32 UTC Modified: 2015-01-09 15:28 UTC
From: stesie at brokenpipe dot de Assigned: jpauli
Status: Closed Package: SQLite related
PHP Version: master-Git-2014-10-18 (Git) OS: unrelated
Private report: No CVE-ID:
 [2014-10-18 21:32 UTC] stesie at brokenpipe dot de
Description:
------------
The SQLite3Result::fetchArray has on *optional* argument, the implementation also handles it as an optional argument.

However the corresponding ARG_INFO_EX block declares a mandatory argument (4th macro parameter):

--- BEGIN ---
ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3result_fetcharray, 0, 0, 1)
ZEND_ARG_INFO(0, mode)
ZEND_END_ARG_INFO()
--- END ---

This does *not* cause problems with the PHP interpreter itself, since it allows calling a function with to few arguments ... after all it's up to the called function to handle that situation well.

However there are extensions (namely "V8Js"), that aim at sandboxing user code and hence apply stricter rules.  Namely V8Js throws an exception in case too few arguments are provided.

Therefore I ask you to please fix the arg info.
Link to bug report against V8Js: https://github.com/preillyme/v8js/issues/26

cheers
  ~stesie


Patches

fix-arginfo.diff (last revision 2014-10-18 21:32 UTC) by stesie at brokenpipe dot de)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-09 15:26 UTC] jpauli@php.net
Automatic comment on behalf of jpauli
Revision: http://git.php.net/?p=php-src.git;a=commit;h=dc810543cfaedd659a81507887e242a3680d5883
Log: Fix bug #68260
 [2015-01-09 15:26 UTC] jpauli@php.net
-Status: Open +Status: Closed
 [2015-01-09 15:27 UTC] jpauli@php.net
Automatic comment on behalf of jpauli
Revision: http://git.php.net/?p=php-src.git;a=commit;h=dc810543cfaedd659a81507887e242a3680d5883
Log: Fix bug #68260
 [2015-01-09 15:27 UTC] jpauli@php.net
Automatic comment on behalf of jpauli
Revision: http://git.php.net/?p=php-src.git;a=commit;h=dc810543cfaedd659a81507887e242a3680d5883
Log: Fix bug #68260
 [2015-01-09 15:27 UTC] jpauli@php.net
-Status: Closed +Status: Feedback
 [2015-01-09 15:27 UTC] jpauli@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.5-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2015-01-09 15:28 UTC] jpauli@php.net
-Status: Feedback +Status: Closed -Assigned To: +Assigned To: jpauli
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Jul 23 14:01:36 2017 UTC