summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd T. Fries <todd@cvs.openbsd.org>2011-12-08 17:04:20 +0000
committerTodd T. Fries <todd@cvs.openbsd.org>2011-12-08 17:04:20 +0000
commit1035792ec3fb8628de6edda50575ee2bb5686641 (patch)
treee460b6037f461024236ed0e22811c0fbb608c76c
parentf9c0325e6a39599391f5df581eb190b6fb68b0c7 (diff)
check for NULL ->ifa_addr, found the hard way by yours truly on his phone
ok chl@ & gilles@
-rw-r--r--usr.sbin/smtpd/parse.y6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/parse.y b/usr.sbin/smtpd/parse.y
index cabc61f0311..3cef3d0de45 100644
--- a/usr.sbin/smtpd/parse.y
+++ b/usr.sbin/smtpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.82 2011/10/27 14:32:57 chl Exp $ */
+/* $OpenBSD: parse.y,v 1.83 2011/12/08 17:04:19 todd Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -1926,6 +1926,8 @@ interface(const char *s, const char *tag, const char *cert,
fatal("getifaddrs");
for (p = ifap; p != NULL; p = p->ifa_next) {
+ if (p->ifa_addr == NULL)
+ continue;
if (strcmp(p->ifa_name, s) != 0 &&
! is_if_in_group(p->ifa_name, s))
continue;
@@ -1988,6 +1990,8 @@ set_localaddrs(void)
m = map_findbyname("localhost");
for (p = ifap; p != NULL; p = p->ifa_next) {
+ if (p->ifa_addr == NULL)
+ continue;
switch (p->ifa_addr->sa_family) {
case AF_INET:
sain = (struct sockaddr_in *)&ss;