On Tue, Dec 20, 2011 at 03:01:34PM +0800, 雷哲 wrote: > In fact, I means that when the length of an string is 6 or 7,i > requests->requestvb->val.val_len != strlen(requests->requestvb->val.string).
Don't use strlen here. There is no guarantee that an SNMP octet string is zero-terminated, or does not contain zero bytes inside it. Always trust the val.val_len to give the correct length. /Niels -- Niels Baggesen - @home - Århus - Denmark - n...@users.sourceforge.net The purpose of computing is insight, not numbers --- R W Hamming ------------------------------------------------------------------------------ Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders