Hi.

The getenv fix you both provided has been applied to V5-2-patches and the main branch. It will be included in 5.2.1 when it is released.

Thanks for the fix!

Alex


Alex Burger wrote:

Hi Daniel.

Philip W Gillis posted the same fix a month ago and I thought I applied
the fix, but it looks like I didn't..

We are already at rc2 for 5.2.1, so I'm not sure if it can go in. I'll check.

Alex


Daniel Kerns wrote:

Hi Folks:
I hope this it the right place to post this.
Building snmpd for win32, I've found the following bug.
In tools.c's netsnmp_getenv() version 5.2.1:
If the "temp = getenv(name);" on line 939 returns non NULL, the next interesting statement executed is:
if (temp) {
setenv(name, temp, 1);
SNMP_FREE(temp);
}
The SNMP_FREE(temp) errors because the pointer in temp was not allocated from the heap.
My local fix is to do this:
DWORD getenv_worked = 0;
temp = getenv(name);
if (temp) {
getenv_worked = 1;
DEBUGSGTL(.....);
}
and later:
if (temp) {
setenv(name, temp, 1);
if (getenv_worked == 0) {
SNMP_FREE(temp);
}
}
Thanks,
Dan


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to