Re: Bug #1251: snmpwalk function causes segfault
| From: | Sascha Schumann | Date: | Sun, 21 Mar 1999 18:13:55 +0000 |
| Subject: | Re: Bug #1251: snmpwalk function causes segfault | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-4709@lists.php.net to get a copy of this message | ||
On Sun, Mar 21, 1999 at 06:09:55PM -0000, lemming@k332.feld.cvut.cz wrote:
> From: lemming@k332.feld.cvut.cz
> Operating system: Linux 2.2.1
> PHP version: 3.0.7
> PHP Bug Type: Reproduceable crash
> Bug description: snmpwalk function causes segfault
>
> 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.
I discussed this already with Rasmus, but have not received an answer
so far:
-----------------------------------------------------------------------------
On Sun, Feb 28, 1999 at 12:42:41PM -0500, Rasmus Lerdorf wrote:
> > Btw, I've been playing around with SNMP lately. Is there any way to get
> > the key identifier when using snmpwalk? It's nice to know the value, but
> > it does not make so much sence without knowing what it is.
>
> Don't think so, and it is actually very useful even without the key name.
> It is of course not useful to do a full MIB walk, but if you are just
> doing a sub-tree, then you know exaxtly what you are requesting and you
> will get out an array containing that sub-tree.
>
> -Rasmus
Hm... that's the prerequisite I don't like. Granted, my experience with snmp
is very limited, but what, if I wanted to simply scan e.g. the interface tree
which may hold entries for interfaces which are dynamically added/removed.
It's late now, I'm tired and thinking hardly takes place: Would there be any
drawback, if php3 would provide the user also with the key?
-----------------------------------------------------------------------------
--
Regards,
Sascha Schumann |
Consultant | finger sas@schell.de
| for PGP public key
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net