Skip to content

Commit

Permalink
Avoid a crash for interfaces without IP addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
jbkempf committed Jan 27, 2018
1 parent 45b8e93 commit a18a9f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ mdns_list_interfaces(multicast_if** pp_intfs, size_t* p_nb_intf, int ai_family)
return (MDNS_NETERR);
nb_if = 0;
for (c = ifs; c != NULL; c = c->ifa_next) {
if (c->ifa_addr->sa_family != ai_family || !mdns_is_interface_valuable(c))
if (c->ifa_addr == NULL ||
c->ifa_addr->sa_family != ai_family ||
!mdns_is_interface_valuable(c))
continue;
nb_if++;
}
Expand Down

0 comments on commit a18a9f1

Please sign in to comment.