diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-08 13:55:57 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-08 13:55:57 +0000 |
commit | c1242ec92864dcc1a85fa8e8386ff9d7f93e6b3c (patch) | |
tree | d6d8283ebb16e0fb639193e34c616fdea8adcd51 /lib/libc/asr/getaddrinfo.c | |
parent | 288cf8c90bb607b966ecc18ea0b16fa1b7c3ebdd (diff) |
Handle case where no hint is passed in. Found as a crash of fdm by jturner@
Diffstat (limited to 'lib/libc/asr/getaddrinfo.c')
-rw-r--r-- | lib/libc/asr/getaddrinfo.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 <eric@openbsd.org> * @@ -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); |