[SNMP4J] Re: BufferOverflowException while encoding a GETNEXT PDU

Tejo Vamsi tejovamsi at yahoo.com
Tue May 3 02:17:20 CEST 2005


Hi Frank,

Yes I am using v1.5 only.

Regards,
Tejo

--- Frank Fock <fock at agentpp.com> wrote:
> Hi Tejo,
> 
> Are you using v1.5 yet?
> 
> Thanks,
> Frank
> 
> Tejo Vamsi wrote:
> 
> >Hi Frank, All,
> >
> >I observed a very uncommon exception when SNMP4J
> was
> >trying to encode a big 
> >(contains 16 varbinds) GETNEXT PDU. The code
> actually
> >failed, when it was
> >trying to encode the OID of the last varbind,
> because
> >it tried to write beyond
> >the allocated buffer size. I suppose, this
> situation
> >of exceeding the buffer size
> >should not occur as the code pre-computes the
> buffer
> >size needed for this encoded
> >PDU and passes that stream to the encode method. I
> am
> >not really sure what is
> >causing the problem. I did not observe this
> scenario
> >in case of other 
> >GETNEXT PDUs. Any specific areas where I need to
> >investigate to fix the problem
> >? By the way is there any limit on the OID length ?
> >
> >Following is the stack trace I got:
>
>-------------------------------------------------------
> >	HeapByteBuffer(Buffer).nextPutIndex() line: 419
> >	HeapByteBuffer.put(byte) line: 145
> >	BEROutputStream.write(int) line: 65
> >	BER.encodeOID(OutputStream, byte, int[]) line: 429
> >	OID.encodeBER(OutputStream) line: 205
> >	VariableBinding.encodeBER(OutputStream) line: 176
> >	ScopedPDU(PDU).encodeBER(OutputStream) line: 465
> >	ScopedPDU.encodeBER(OutputStream) line: 127
> >	MPv3.prepareOutgoingMessage(Address, int, int,
> int,
> >byte[], int, PDU, boolean, PduHandle, Address,
> >BEROutputStream) line: 601
> >	MessageDispatcherImpl.sendPdu(TransportMapping,
> >Address, int, int, byte[], int, PDU, boolean) line:
> >375
> >	Snmp.sendMessage(PDU, Target, TransportMapping)
> line:
> >885
> >	Snmp.send(PDU, Target, TransportMapping, Object,
> >ResponseListener) line: 783
> >	Snmp.send(PDU, Target, Object, ResponseListener)
> >line: 771
>
>-------------------------------------------------------
> >
> >Thanks for your time.
> >
> >Regards,
> >Tejo
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> >http://mail.yahoo.com 
> >
> >  
> >
> 
> 
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the SNMP4J mailing list