mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-24 02:47:52 +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: fe0139ee98
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user