summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbenno <benno@openbsd.org>2020-12-30 18:41:33 +0000
committerbenno <benno@openbsd.org>2020-12-30 18:41:33 +0000
commit8435d35a4e407dce21f64eea66f6490f87a15523 (patch)
tree147389df70ee0084998b1e999c58ddf5f73bc3e3
parentgetifaddrs() can return entries where ifa_addr is NULL. Check for this (diff)
downloadwireguard-openbsd-8435d35a4e407dce21f64eea66f6490f87a15523.tar.xz
wireguard-openbsd-8435d35a4e407dce21f64eea66f6490f87a15523.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/ldapd/parse.y4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/ldapd/parse.y b/usr.sbin/ldapd/parse.y
index c003b3fcb6a..afe09d947b6 100644
--- a/usr.sbin/ldapd/parse.y
+++ b/usr.sbin/ldapd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.37 2020/11/29 19:48:35 tb Exp $ */
+/* $OpenBSD: parse.y,v 1.38 2020/12/30 18:41:33 benno Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martinh@openbsd.org>
@@ -1122,6 +1122,8 @@ interface(const char *s, const char *cert,
for (p = ifap; p != NULL; p = p->ifa_next) {
if (strcmp(s, p->ifa_name) != 0)
continue;
+ if (p->ifa_addr == NULL)
+ continue;
switch (p->ifa_addr->sa_family) {
case AF_INET: