mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-28 09:19:53 +00:00
DNS: Fix potential array out of bounds access. Variable nanswers may contain bogus values. (found by Coverity)
This commit is contained in:
parent
78a36df901
commit
288b4564e4
@ -1129,7 +1129,7 @@ dns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr,
|
|||||||
/* skip the rest of the "question" part */
|
/* skip the rest of the "question" part */
|
||||||
res_idx += SIZEOF_DNS_QUERY;
|
res_idx += SIZEOF_DNS_QUERY;
|
||||||
|
|
||||||
while (nanswers > 0) {
|
while ((nanswers > 0) && (res_idx < p->tot_len)) {
|
||||||
/* skip answer resource record's host name */
|
/* skip answer resource record's host name */
|
||||||
res_idx = dns_parse_name(p, res_idx);
|
res_idx = dns_parse_name(p, res_idx);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user