You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running into a problem where gosnmp (and WapSNMP if that matters) fails to decode large counter 64 values.
Here's an example with logging enabled. I added a log line to parseInt64 to dump the input bytes:
Packet sanity verified, we got all the bytes ([62])
parseInt64: 01
Parsed version [1]
Parsed community [redacted]
getResponseLength: [43]
parseInt64: d4 6a 68 fa
requestID: [3563743482]
parseInt64: 00
errorStatus: [0]
parseInt64: 00
error-index: [0]
vblLength: [29]
OID: [.1.3.6.1.2.1.31.1.1.1.11.502]
[decodeValue: type is Counter64]
parseInt64: 00 ff ff ff ff ff 1e e5 3a
decodeValue: err is [integer too large]
9 bytes are passed into parseInt64: 00 ff ff ff ff ff 1e e5 3a, which causes it to immediately fail. snmp4j (and net-snmp) both successfully parse this value simply dropping the leading 0-octet.
Hi,
I'm running into a problem where gosnmp (and WapSNMP if that matters) fails to decode large counter 64 values.
Here's an example with logging enabled. I added a log line to parseInt64 to dump the input bytes:
9 bytes are passed into parseInt64: 00 ff ff ff ff ff 1e e5 3a, which causes it to immediately fail. snmp4j (and net-snmp) both successfully parse this value simply dropping the leading 0-octet.
Please see http://grepcode.com/file/repo1.maven.org/maven2/org.snmp4j/snmp4j/1.8.1/org/snmp4j/asn1/BER.java#BER.decodeUnsignedInt64%28org.snmp4j.asn1.BERInputStream%2Corg.snmp4j.asn1.BER.MutableByte%29 for how this is handled in snmp4j.
The text was updated successfully, but these errors were encountered: