php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70476 Wront arginfo for SNMP::setSecurity
Submitted: 2015-09-11 15:53 UTC Modified: 2016-06-06 07:15 UTC
From: contact at jubianchi dot fr Assigned: lytboris (profile)
Status: Closed Package: SNMP related
PHP Version: 5.5.29 OS: Irrevelant
Private report: No CVE-ID: None
 [2015-09-11 15:53 UTC] contact at jubianchi dot fr
Description:
------------
SNMP::setSecurity are wrong: it reports an extra 9th argument with no name.
See here for the commit in which it was introduced: https://github.com/php/php-src/commit/5e82e334ddffcf577542a74a37f3388d14790686#diff-6c46b817f999c7766e794fca1a93c68aR377

This extra argument does not seem to be used, not documented:

* https://github.com/php/php-src/blob/master/ext/snmp/snmp.c#L1908-L1909
* http://fr.php.net/manual/en/snmp.setsecurity.php

Test script:
---------------
reflection::export(new reflectionmethod('snmp', 'setSecurity'));

Expected result:
----------------
Method [ <internal:snmp> public method setSecurity ] {

  - Parameters [8] {
    Parameter #0 [ <required> $session ]
    Parameter #1 [ <required> $sec_level ]
    Parameter #2 [ <required> $auth_protocol ]
    Parameter #3 [ <required> $auth_passphrase ]
    Parameter #4 [ <required> $priv_protocol ]
    Parameter #5 [ <required> $priv_passphrase ]
    Parameter #6 [ <required> $contextName ]
    Parameter #7 [ <required> $contextEngineID ]
  }
}

Actual result:
--------------
Method [ <internal:snmp> public method setSecurity ] {

  - Parameters [9] {
    Parameter #0 [ <required> $session ]
    Parameter #1 [ <required> $sec_level ]
    Parameter #2 [ <required> $auth_protocol ]
    Parameter #3 [ <required> $auth_passphrase ]
    Parameter #4 [ <required> $priv_protocol ]
    Parameter #5 [ <required> $priv_passphrase ]
    Parameter #6 [ <required> $contextName ]
    Parameter #7 [ <required> $contextEngineID ]
    Parameter #8 [ <optional> $ ]
  }
}

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-09-11 15:55 UTC] contact at jubianchi dot fr
I just submitted a PR to fix this: https://github.com/php/php-src/pull/1516
 [2016-06-06 07:15 UTC] lytboris@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: lytboris
 [2016-06-06 07:15 UTC] lytboris@php.net
Pull request is merged, thanks for your contribution!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC