Skip to content

Commit

Permalink
Fix more of the same crash
Browse files Browse the repository at this point in the history
  • Loading branch information
jbkempf committed Mar 1, 2018
1 parent fe95893 commit efdf275
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mdns.c
Expand Up @@ -117,7 +117,9 @@ mdns_list_interfaces(multicast_if** pp_intfs, size_t* p_nb_intf, int ai_family)
return (MDNS_ERROR);
}
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;
memcpy(intfs, c->ifa_addr, sizeof(*intfs));
intfs++;
Expand Down

0 comments on commit efdf275

Please sign in to comment.