mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-04-17 11:42:56 +00:00
Fixed NULL dereferencing for zero length raw data.
This commit is contained in:
parent
eabfb233b8
commit
d079aae0e0
@ -596,8 +596,11 @@ snmp_asn1_enc_raw(struct pbuf *p, u16_t ofs, u8_t raw_len, u8_t *raw)
|
||||
msg_ptr++;
|
||||
}
|
||||
}
|
||||
/* copy last octet */
|
||||
*msg_ptr = *raw;
|
||||
if (raw_len > 0)
|
||||
{
|
||||
/* copy last or single octet */
|
||||
*msg_ptr = *raw;
|
||||
}
|
||||
return ERR_OK;
|
||||
}
|
||||
p = p->next;
|
||||
|
Loading…
x
Reference in New Issue
Block a user