php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44166 Parameter handling flaw in PDO::getAvailableDrivers()
Submitted: 2008-02-19 13:00 UTC Modified: 2008-03-03 21:14 UTC
From: uwendel at mysql dot com Assigned:
Status: Closed Package: PDO related
PHP Version: 5.3CVS-2008-02-19 (CVS) OS: Linux
Private report: No CVE-ID:
 [2008-02-19 13:00 UTC] uwendel at mysql dot com
Description:
------------
There's a little parameter handling flaw in PDO::getAvailableDrivers(). The function expects no parameter to be passed. If you pass some, it does not bail like most other functions do which do not expect any parameter.

nixnutz@ulflinux:~/php53> sapi/cli/php -r 'var_dump(PDO::getAvailableDrivers("too many", "args")); var_dump(get_include_path("too many", "args"));'
array(4) {
  [0]=>
  string(7) "sqlite2"
  [1]=>
  string(6) "sqlite"
  [2]=>
  string(5) "pgsql"
  [3]=>
  string(5) "mysql"
}

Warning: get_include_path() expects exactly 0 parameters, 2 given in Command line code on line 1
NULL


Reproduce code:
---------------
nixnutz@ulflinux:~/php53> sapi/cli/php -r 'var_dump(PDO::getAvailableDrivers("too many", "args"));'


Expected result:
----------------
Warning: PDO::getAvailableDrivers() expects exactly 0 parameters, 2 given in Command line code on line %d
NULL

Actual result:
--------------
No warning, array returned

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-19 13:18 UTC] uwendel at mysql dot com

 [2008-02-19 13:19 UTC] uwendel at mysql dot com
Oh, well forgot to say that for using the test you also have to decide on #44155.
 [2008-03-03 21:14 UTC] iliaa@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.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 23 18:01:55 2014 UTC