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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: contact at jubianchi dot fr
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

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-2019 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 16:01:23 2019 UTC