Fixed NULL dereferencing for zero length raw data.

This commit is contained in:
christiaans 2006-09-22 07:59:44 +00:00
parent eabfb233b8
commit d079aae0e0

View File

@ -596,8 +596,11 @@ snmp_asn1_enc_raw(struct pbuf *p, u16_t ofs, u8_t raw_len, u8_t *raw)
msg_ptr++; msg_ptr++;
} }
} }
/* copy last octet */ if (raw_len > 0)
{
/* copy last or single octet */
*msg_ptr = *raw; *msg_ptr = *raw;
}
return ERR_OK; return ERR_OK;
} }
p = p->next; p = p->next;