Skip to content
Snippets Groups Projects
Commit 07ce0151 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-radvd: fix NULL deref

The specification says that the ifa_addr field of struct ifaddrs may be NULL,
and in Barrier Breaker, this does actually occur...
parent ce1a160b
No related branches found
No related tags found
No related merge requests found
...@@ -266,7 +266,7 @@ static void update_interface(void) { ...@@ -266,7 +266,7 @@ static void update_interface(void) {
memset(&G.iface.ifaddr, 0, sizeof(G.iface.ifaddr)); memset(&G.iface.ifaddr, 0, sizeof(G.iface.ifaddr));
for (addr = addrs; addr; addr = addr->ifa_next) { for (addr = addrs; addr; addr = addr->ifa_next) {
if (addr->ifa_addr->sa_family != AF_INET6) if (!addr->ifa_addr || addr->ifa_addr->sa_family != AF_INET6)
continue; continue;
const struct sockaddr_in6 *in6 = (const struct sockaddr_in6 *)addr->ifa_addr; const struct sockaddr_in6 *in6 = (const struct sockaddr_in6 *)addr->ifa_addr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment