netdev: Fix crash when ifa_netmask is null.
glibc sometimes doesn't initialize the ifa_netmask and ifa_addr fields, if
the ioctl to fetch them fails.  Check ifa_name also just for paranoia.
@@ -1967,7 +1967,8 @@ netdev_get_addrs(const char dev[], struct in6_addr **paddr,
for (ifa = if_addr_list; ifa; ifa = ifa->ifa_next) {
int family;
- if (strncmp(ifa->ifa_name, dev, IFNAMSIZ) || ifa->ifa_addr == NULL) {
+ if (!ifa->ifa_name || !ifa->ifa_addr || !ifa->ifa_netmask
+ || strncmp(ifa->ifa_name, dev, IFNAMSIZ)) {
continue;
}
