This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
SNMP BULKGET writes to NULL pointer on multiple var reqest.
- From: Tad <ecos_removethispart at ds3switch dot com>
- To: ecos-discuss at sources dot redhat dot com
- Date: Sat, 15 Mar 2008 19:34:39 -0800
- Subject: [ECOS] SNMP BULKGET writes to NULL pointer on multiple var reqest.
NULL pointer write on "bulkget system icmp"
snmp_agent.c:handle_one_var() doesn't check NULL value of return pointer
after calling snmp_add_null_var(). On my setup, writes to NULL pointer
structure from a "bulkget system icmp" request.
Not sure why snmp_add_null_var() returned NULL (many cases do) or what
proper fix is.
It's here:
http://exr.lunn.ch/http/source/packages/net/snmp/agent/current/src/snmp_agent.c#L453
var_ptr2 = snmp_add_null_var(asp->pdu, var_ptr->name, MAX_OID_LEN);
for ( i=var_ptr->name_length ; i<MAX_OID_LEN ; i++)
!!! var_ptr2->name[i] = 0;
!!! var_ptr2->name_length = var_ptr->name_length;
allDone = FALSE;
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss