From c1242ec92864dcc1a85fa8e8386ff9d7f93e6b3c Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Thu, 8 Oct 2015 13:55:57 +0000 Subject: Handle case where no hint is passed in. Found as a crash of fdm by jturner@ --- lib/libc/asr/getaddrinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc/asr/getaddrinfo.c') diff --git a/lib/libc/asr/getaddrinfo.c b/lib/libc/asr/getaddrinfo.c index e932e46b948..b6ce8a9d64d 100644 --- a/lib/libc/asr/getaddrinfo.c +++ b/lib/libc/asr/getaddrinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getaddrinfo.c,v 1.7 2015/10/07 13:57:12 deraadt Exp $ */ +/* $OpenBSD: getaddrinfo.c,v 1.8 2015/10/08 13:55:56 deraadt Exp $ */ /* * Copyright (c) 2012 Eric Faurot * @@ -32,7 +32,7 @@ getaddrinfo(const char *hostname, const char *servname, struct asr_result ar; int saved_errno = errno; - if ((hints->ai_flags & AI_NUMERICHOST) == 0) + if (hints && (hints->ai_flags & AI_NUMERICHOST) == 0) res_init(); as = getaddrinfo_async(hostname, servname, hints, NULL); -- cgit v1.2.3