Skip to content

Commit

Permalink
mdns: Handle header parsing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chouquette committed Mar 19, 2020
1 parent 80860fa commit 4fb1828
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,8 @@ mdns_recv(const struct mdns_conn* conn, struct mdns_hdr *hdr, struct rr_entry **

n = (size_t)length;
const uint8_t *ptr = mdns_read_header(buf, &n, hdr);
if (ptr == NULL)
return (MDNS_ERROR);

num_entry = hdr->num_qn + hdr->num_ans_rr + hdr->num_add_rr;
for (size_t i = 0; i < num_entry; ++i) {
Expand Down

0 comments on commit 4fb1828

Please sign in to comment.