mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-11 07:10:09 +02:00
gthreadedresolver: fix crash in loopback interface check
It's expected that an interface may have a NULL socket address, so just skip it and don't crash if so. In practice, this occurs for VPN interfaces. Fixes: fe0139ee985075f3c12932d7123cb594356e7e9d
This commit is contained in:
parent
44ac298dca
commit
defec7eef2
@ -292,8 +292,11 @@ check_only_has_loopback_interfaces (void)
|
||||
for (struct ifaddrs *addr = addrs; addr; addr = addr->ifa_next)
|
||||
{
|
||||
struct sockaddr *sa = addr->ifa_addr;
|
||||
GSocketAddress *saddr = g_socket_address_new_from_native (sa, sizeof (struct sockaddr));
|
||||
GSocketAddress *saddr;
|
||||
if (!sa)
|
||||
continue;
|
||||
|
||||
saddr = g_socket_address_new_from_native (sa, sizeof (struct sockaddr));
|
||||
if (!saddr)
|
||||
continue;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user