check if ifa_addr is NULL before trying to access it. Bug #144300

        * src/info.c: (info_get_nic_information), (info_get_interfaces):
        check if ifa_addr is NULL before trying to access it. Bug #144300
parent 8b7a51b1
2004-06-14 Fernando Herrera <fherrera@onirica.com>
* src/info.c: (info_get_nic_information), (info_get_interfaces):
check if ifa_addr is NULL before trying to access it. Bug #144300
2004-06-13 Jürg Billeter <j@bitron.ch>
Fixes #144278
......
......@@ -390,6 +390,10 @@ info_get_nic_information (const gchar *nic, Netinfo *info)
continue;
}
if (ifr6->ifa_addr == NULL) {
continue;
}
switch (ifr6->ifa_addr->sa_family) {
case AF_INET6:
......@@ -594,7 +598,7 @@ info_get_interfaces (Netinfo *info)
for (ifr = ifa0; ifr; ifr = ifr->ifa_next) {
iface = g_strdup (ifr->ifa_name);
if (((ifr->ifa_flags & IFF_UP) != 0) &&
if (((ifr->ifa_flags & IFF_UP) != 0) && ifr->ifa_addr &&
(ifr->ifa_addr->sa_family == AF_INET6)) {
ipv6 = TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment