mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-29 19:46:19 +08:00
mdns: Add null check for pbuf_skip
This commit is contained in:
committed by
Simon Goldschmidt
parent
1c5cc7bc02
commit
e3a20b3bc2
@@ -1889,6 +1889,10 @@ mdns_handle_response(struct mdns_packet *pkt, struct netif *netif)
|
||||
flags = MDNS_SEARCH_RESULT_FIRST | MDNS_SEARCH_RESULT_LAST;
|
||||
}
|
||||
p = pbuf_skip(pkt->pbuf, ans.rd_offset, &offset);
|
||||
if (p == NULL) {
|
||||
LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Malformed response packet, aborting\n"));
|
||||
return;
|
||||
}
|
||||
if (ans.info.type == DNS_RRTYPE_PTR || ans.info.type == DNS_RRTYPE_SRV) {
|
||||
/* Those RR types have compressed domain name. Must uncompress here,
|
||||
since cannot be done without pbuf. */
|
||||
|
||||
Reference in New Issue
Block a user