php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1251 snmpwalk function causes segfault
Submitted: 1999-03-21 13:09 UTC Modified: 1999-04-05 14:34 UTC
From: lemming at k332 dot feld dot cvut dot cz Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.7 OS: Linux 2.2.1
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: lemming at k332 dot feld dot cvut dot cz
New email:
PHP Version: OS:

 

 [1999-03-21 13:09 UTC] lemming at k332 dot feld dot cvut dot cz
Hello.

There is a bug in the snmpwalk() function when used with ucd-snmp
3.6.1. This version of UCD frees the 'community' string on snmp_close(),
but PHP does not malloc this string - it passes pointer to variable.

When following program is ran with PHP 3.0.7 and UCD 3.6.1, it
always crashes:

<?
  $a = snmpwalk("localhost","public","system");
?>

BTW: Current implementation of SNMPWALK is useless - it should
return string-indexed array and not just array of values. You need
to know to which variable the value belongs.

Michal Kara alias lemming

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-04-05 14:34 UTC] sas
I cannot reproduce that effect here. Could you provide a backtrace?

snmprealwalk is in CVS now. 
--------------
The next release of UCD SNMP will contain a bug fix for this effect. 
I've committed a temporary workaround (as suggested by Michael Kara and Mike Slifcak) to the PHP CVS. It still lacks proper detection, if strdup'ing is necessary.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 22:01:29 2024 UTC