Skip to content

Commit

Permalink
mdns: Fix potential null deref reported by fuzzer test
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cermak committed Feb 16, 2022
1 parent 33f7009 commit c0e105c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/mdns/mdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -2821,7 +2821,8 @@ static bool _mdns_question_matches(mdns_parsed_question_t * question, uint16_t t
if (type == MDNS_TYPE_A || type == MDNS_TYPE_AAAA) {
return true;
} else if (type == MDNS_TYPE_PTR || type == MDNS_TYPE_SDPTR) {
if (!strcasecmp(service->service->service, question->service)
if (question->service && question->proto && question->domain
&& !strcasecmp(service->service->service, question->service)
&& !strcasecmp(service->service->proto, question->proto)
&& !strcasecmp(MDNS_DEFAULT_DOMAIN, question->domain)) {
return true;
Expand Down

0 comments on commit c0e105c

Please sign in to comment.