mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 21:44:38 +08: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++;
|
msg_ptr++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* copy last octet */
|
if (raw_len > 0)
|
||||||
*msg_ptr = *raw;
|
{
|
||||||
|
/* copy last or single octet */
|
||||||
|
*msg_ptr = *raw;
|
||||||
|
}
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
p = p->next;
|
p = p->next;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user