]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
fix segmentation fault if there is no IP address on an interface (fixes #320) 325/head
authorKonrad Bucheli <kb@open.ch>
Fri, 6 Dec 2019 09:06:38 +0000 (10:06 +0100)
committerKonrad Bucheli <kb@open.ch>
Fri, 6 Dec 2019 09:06:38 +0000 (10:06 +0100)
ui/net.c

index 6e4942eb6e95228deda8d77f476c13b528d0fcfe..d589d2ecfb5dd2983b93eacd20657c4a0033706b 100644 (file)
--- 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) {