I noticed that whenever I use an override in my snmpd.conf file, I get a core
dump. I compiled net-snmp-5.1.1 on slackware 9.1.

For example:

        override sysDescr.0 octet_str "foo"

will cause the daemon to toss core while it is parsing the config file.

The problem is in agent_registry.c, line 566:
    subtree->label_a = strdup(moduleName);

In this case, moduleName is NULL. strdup() will throw core when it gets a NULL.

I found that the following band-aid:
    subtree->label_a = (moduleName == NULL) ? strdup("") : strdup(moduleName);
will fix it up. 

I see the same code in 5.0.9 where it didn't cause problems. Presumably
moduleName wasn't NULL.

There is probably a better way to fix this, maybe by producing a legitimate
string in the override code but I don't know what a legitimate string would be.

Anybody else seen this?

If there's anything else I can do to help, please let me know.

--john


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to