Initialized oid_len variable to prevent OID buffer overflow.
The oid_len value is passed down to OID parsing function that uses the value to check if a buffer overflow condition occured.
@@ -115,7 +115,7 @@ snmp_message_decode(uint8_t *buf, uint32_t buf_len, snmp_header_t *header,
snmp_varbind_t *varbinds, uint32_t *varbind_num)
{
uint8_t type, len;
- uint32_t i, oid_len;
+ uint32_t i, oid_len = SNMP_MSG_OID_MAX_LEN;
buf = snmp_ber_decode_type(buf, &buf_len, &type);
if(buf == NULL) {
