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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 10:01:29 2025 UTC