summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbenno <benno@openbsd.org>2020-12-30 18:40:22 +0000
committerbenno <benno@openbsd.org>2020-12-30 18:40:22 +0000
commit5e1df7ef28f2f6402263bfe14fb3f99a313958e7 (patch)
tree90deb82f24f74489571b7d1f36c6d40766216f6e
parentgetifaddrs() can return entries where ifa_addr is NULL. Check for this (diff)
downloadwireguard-openbsd-5e1df7ef28f2f6402263bfe14fb3f99a313958e7.tar.xz
wireguard-openbsd-5e1df7ef28f2f6402263bfe14fb3f99a313958e7.zip
getifaddrs() can return entries where ifa_addr is NULL. Check for this
before accessing anything in ifa_addr. ok claudio@
-rw-r--r--usr.sbin/httpd/parse.y5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/httpd/parse.y b/usr.sbin/httpd/parse.y
index b3c8786aaee..45eaa1ab003 100644
--- a/usr.sbin/httpd/parse.y
+++ b/usr.sbin/httpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.121 2020/11/20 20:39:31 jung Exp $ */
+/* $OpenBSD: parse.y,v 1.122 2020/12/30 18:40:22 benno Exp $ */
/*
* Copyright (c) 2020 Matthias Pressfreund <mpfr@fn.de>
@@ -2124,7 +2124,8 @@ host_if(const char *s, struct addresslist *al, int max,
nextaf:
for (p = ifap; p != NULL && cnt < max; p = p->ifa_next) {
- if (p->ifa_addr->sa_family != af ||
+ if (p->ifa_addr == NULL ||
+ p->ifa_addr->sa_family != af ||
(strcmp(s, p->ifa_name) != 0 &&
!is_if_in_group(p->ifa_name, s)))
continue;