From c172c1babcbfda1c356956295775be16fd469cf1 Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Fri, 30 Jan 2015 16:41:44 +0000 Subject: fix a possible NULL-deref when trying to deref ifa->ifa_addr ok eric@ --- lib/libc/asr/getaddrinfo_async.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libc/asr/getaddrinfo_async.c b/lib/libc/asr/getaddrinfo_async.c index 162759f80de..0b8b5e71fee 100644 --- a/lib/libc/asr/getaddrinfo_async.c +++ b/lib/libc/asr/getaddrinfo_async.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getaddrinfo_async.c,v 1.32 2015/01/14 23:36:15 deraadt Exp $ */ +/* $OpenBSD: getaddrinfo_async.c,v 1.33 2015/01/30 16:41:43 gilles Exp $ */ /* * Copyright (c) 2012 Eric Faurot * @@ -218,6 +218,8 @@ getaddrinfo_async_run(struct asr_query *as, struct asr_result *ar) for (ifa = ifa0; ifa != NULL; ifa = ifa->ifa_next) { if (ifa->ifa_flags & IFF_LOOPBACK) continue; + if (ifa->ifa_addr == NULL) + continue; if (ifa->ifa_addr->sa_family == PF_INET) v4 = 1; else if (ifa->ifa_addr->sa_family == PF_INET6 && -- cgit v1.2.3