Fixes an occasional segfault caused by an out-of-bounds reference in config file parsing.
/* Loop through interfaces, looking for given IP address */
for (ifptr = iflist; ifptr != NULL; ifptr = ifptr->ifa_next) {
- memset(&ifaces[total], '\0', sizeof(ifaces[total]));
-
- copy_size = sizeof(struct sockaddr_in);
-
if (!ifptr->ifa_addr || !ifptr->ifa_netmask) {
continue;
}
continue;
}
+ memset(&ifaces[total], '\0', sizeof(ifaces[total]));
+
+ copy_size = sizeof(struct sockaddr_in);
+
ifaces[total].flags = ifptr->ifa_flags;
#if defined(HAVE_IPV6)