mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-19 05:10:40 +00:00
mdns: Add null check for pbuf_skip
This commit is contained in:
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;
|
flags = MDNS_SEARCH_RESULT_FIRST | MDNS_SEARCH_RESULT_LAST;
|
||||||
}
|
}
|
||||||
p = pbuf_skip(pkt->pbuf, ans.rd_offset, &offset);
|
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) {
|
if (ans.info.type == DNS_RRTYPE_PTR || ans.info.type == DNS_RRTYPE_SRV) {
|
||||||
/* Those RR types have compressed domain name. Must uncompress here,
|
/* Those RR types have compressed domain name. Must uncompress here,
|
||||||
since cannot be done without pbuf. */
|
since cannot be done without pbuf. */
|
||||||
|
@ -1203,7 +1203,7 @@ pbuf_skip_const(const struct pbuf *in, u16_t in_offset, u16_t *out_offset)
|
|||||||
* @param in input pbuf
|
* @param in input pbuf
|
||||||
* @param in_offset offset to skip
|
* @param in_offset offset to skip
|
||||||
* @param out_offset resulting offset in the returned pbuf
|
* @param out_offset resulting offset in the returned pbuf
|
||||||
* @return the pbuf in the queue where the offset is
|
* @return the pbuf in the queue where the offset is or NULL when the offset is too high
|
||||||
*/
|
*/
|
||||||
struct pbuf *
|
struct pbuf *
|
||||||
pbuf_skip(struct pbuf *in, u16_t in_offset, u16_t *out_offset)
|
pbuf_skip(struct pbuf *in, u16_t in_offset, u16_t *out_offset)
|
||||||
|
Loading…
Reference in New Issue
Block a user