From: Konrad Bucheli Date: Fri, 6 Dec 2019 09:06:38 +0000 (+0100) Subject: fix segmentation fault if there is no IP address on an interface (fixes #320) X-Git-Tag: v0.94~18^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F325%2Fhead;p=thirdparty%2Fmtr.git fix segmentation fault if there is no IP address on an interface (fixes #320) --- diff --git a/ui/net.c b/ui/net.c index 6e4942e..d589d2e 100644 --- a/ui/net.c +++ b/ui/net.c @@ -629,7 +629,7 @@ static void net_find_interface_address_from_name( interface = ifaddrs; while (interface != NULL) { - if (!strcmp(interface->ifa_name, interface_name)) { + if (interface->ifa_addr != NULL && !strcmp(interface->ifa_name, interface_name)) { found_interface_name = 1; if (interface->ifa_addr->sa_family == address_family) {