From 07ce01517c27566fd1eab9b941b1547bb553ff7e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 4 Aug 2014 22:57:26 +0200 Subject: [PATCH] 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... --- package/gluon-radvd/src/gluon-radvd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-radvd/src/gluon-radvd.c b/package/gluon-radvd/src/gluon-radvd.c index 801d9854..bd57eabc 100644 --- a/package/gluon-radvd/src/gluon-radvd.c +++ b/package/gluon-radvd/src/gluon-radvd.c @@ -266,7 +266,7 @@ static void update_interface(void) { memset(&G.iface.ifaddr, 0, sizeof(G.iface.ifaddr)); 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; const struct sockaddr_in6 *in6 = (const struct sockaddr_in6 *)addr->ifa_addr;