On 31/10/06, Wes Hardaker <[EMAIL PROTECTED]> wrote:
> Applied. Personally, I think this is not a minor change at all. I
> agree it's probably the right thing to do, but without reviewing that
> all calls to it successful watch out for a 0 return should be done.
> Have you done such an analysis? Cause otherwise you'll end up with a
> crash, which is worse than a non-compile.
I'm not sure that this patch is quite right.
Most of the uses of NETSNMP_LOOKUP (in mibII/*.c) don't check the
return value at all. So the code looks something like:
NETSNMP_LOOKUP(x, (char *)&buf, sizeof(buf));
which would expand to
(0);
Is that valid?
There are a couple of uses of the form
if (NETSNMP_LOOKUP(....))
or
if (!NETSNMP_LOOKUP(....))
which should work OK.
But there are also a couple of uses of the form
if (NETSNMP_LOOKUP(....) < 0) {
// fail
}
which this patch will (erroneously) treat as success.
Dave
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders