Check to prevent snmp request/response oid length more than 128 subids

This is a discussion on Check to prevent snmp request/response oid length more than 128 subids within the SNMP Coders forums, part of the Networking and Network Related category; Hi, The while loop which extracts subids (=A0while (length > 0 && (*objidlength= )-- > 0) { ... in asn_parse_objid()) makes *objidlength =...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-03-2008
saifulla Mohd Abdul
 
Posts: n/a
Default Check to prevent snmp request/response oid length more than 128 subids

Hi,
The while loop which extracts subids (=A0while (length > 0 && (*objidlength=
)-- > 0) { ... in asn_parse_objid()) makes *objidlength =3D -1 for OIDs=A0t=
hat contain=A0more than 128 subids.
So=A0need=A0"*objidlenth =3D MAX_OID_LEN;" inside if(0!=3DNULL).
Please give your comment.

Index: snmplib/asn1.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D
RCS file: /cvsroot/net-snmp/net-snmp/snmplib/asn1.c,v
retrieving revision =

diff -u -p -r5.9 asn1.c
@@ -1301,6 +1301,11 @@ asn_parse_objid(u_char * data,
=A0 =A0 =A0 =A0 *oidp++ =3D (oid) subidentifier;
=A0 =A0 }

=A0=A0=A0 if (0 !=3D length) {
=A0=A0=A0=A0=A0=A0=A0 ERROR_MSG("OID length exceeds buffer size");
+=A0=A0=A0=A0 *objidlenth =3D MAX_OID_LEN;
=A0=A0=A0=A0=A0=A0=A0 return NULL;
=A0=A0=A0 }

=A0=A0=A0 /*
=A0 =A0 =A0 * The first two subidentifiers are encoded into the first compo=
nent
=A0 =A0 =A0 * with the value (X * 40) + Y, where:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D


With Regards,
Saif


__________________________________________________ _________ =

Yahoo! For Good. Give and get cool things for free, reduce waste and help o=
ur planet. Plus find hidden Yahoo! treasure =


http://green.yahoo.com/uk/earth-day/

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference =

Don't miss this year's exciting event. There's still time to save $100. =

Use priority code J8TL2D2. =

http://ad.doubleclick.net/clk;198757....sun.com/java=
one
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:57 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0