[SNMP4J] java.lang.StackOverflowError

Frank Fock fock at agentpp.com
Thu Jun 17 23:57:44 CEST 2004


Hello Mike,

thanks for the bug report, although it has been already discussed on 
this list.
Anyway, the fix will be available soon. Please see the mailing list 
archive for
an easy work-around for this problem.

Best regards,
Frank

 Michael Higgins wrote:

> Hello,
>
> I've recently started working with this software and so far quite 
> pleased.  Good Job!  I did find a something that I think is a bug.    
> I'm implementing  an agent to emulate some functionality on a device 
> we are developing.  We use version 2c of the protocol.  At 
> initialization I set the agent to 2c.
>
> During the course of processing, the snmp client I'm using (developed 
> by another group) issues a get-next for three of our private oids.  
> Instead of setting the protocol to version 2c, it inadverdently sets 
> the pdu to version 1.
> Basically it boils down to recursive calls  in getting the 
> BERPayloadLengthPDU
>
> This fixes my problem (corrections in PDUv1):
>
> protected int getBERPayloadLengthPDU() {
>   if (getType() != PDU.V1TRAP) {
>      // should be this...
>     return super.getBERPayloadLengthPDU();
>      // not this...
>     //return super.getBERPayloadLength();
>   }
>   else {
>     int length = 0;
>     // length for all vbs
>     for (int i = 0; i < variableBindings.size(); i++) {
>       length += 
> ((VariableBinding)variableBindings.get(i)).getBERLength();
>     }
>     length += BER.getBERLengthOfLength(length) + 1;
>     length += agentAddress.getBERLength();
>     length += enterprise.getBERLength();
>     length += genericTrap.getBERLength();
>     length += specificTrap.getBERLength();
>     length += timeStamp.getBERLength();
>     return length;
>   }
> }
>
> Mike
>
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://p15141779.pureserver.info/mailman/listinfo/snmp4j
>





More information about the SNMP4J mailing list