diff options
author | Sebastian Benoit <benno@cvs.openbsd.org> | 2020-12-30 18:41:34 +0000 |
---|---|---|
committer | Sebastian Benoit <benno@cvs.openbsd.org> | 2020-12-30 18:41:34 +0000 |
commit | 782536f481b54056f1383336a1f94a8f37012af9 (patch) | |
tree | 07738e6f77abeb6924113049a4e197fed98b22b5 /usr.sbin/httpd | |
parent | 5b48b437dfb875dac217981de7232ff2142e221d (diff) |
getifaddrs() can return entries where ifa_addr is NULL. Check for this
before accessing anything in ifa_addr.
ok claudio@
Diffstat (limited to 'usr.sbin/httpd')
-rw-r--r-- | usr.sbin/httpd/parse.y | 5 |
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; |