summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--canohost.c4
-rw-r--r--dns.c13
-rw-r--r--sshconnect.c4
3 files changed, 15 insertions, 6 deletions
diff --git a/canohost.c b/canohost.c
index 8270500d3..42011fd0a 100644
--- a/canohost.c
+++ b/canohost.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: canohost.c,v 1.62 2007/12/27 14:22:08 dtucker Exp $ */ 1/* $OpenBSD: canohost.c,v 1.63 2008/06/12 00:03:49 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -89,7 +89,7 @@ get_remote_hostname(int sock, int use_dns)
89 memset(&hints, 0, sizeof(hints)); 89 memset(&hints, 0, sizeof(hints));
90 hints.ai_socktype = SOCK_DGRAM; /*dummy*/ 90 hints.ai_socktype = SOCK_DGRAM; /*dummy*/
91 hints.ai_flags = AI_NUMERICHOST; 91 hints.ai_flags = AI_NUMERICHOST;
92 if (getaddrinfo(name, "0", &hints, &ai) == 0) { 92 if (getaddrinfo(name, NULL, &hints, &ai) == 0) {
93 logit("Nasty PTR record \"%s\" is set up for %s, ignoring", 93 logit("Nasty PTR record \"%s\" is set up for %s, ignoring",
94 name, ntop); 94 name, ntop);
95 freeaddrinfo(ai); 95 freeaddrinfo(ai);
diff --git a/dns.c b/dns.c
index a89176f88..a7da03fa3 100644
--- a/dns.c
+++ b/dns.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dns.c,v 1.24 2007/01/03 03:01:40 stevesk Exp $ */ 1/* $OpenBSD: dns.c,v 1.25 2008/06/12 00:03:49 dtucker Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2003 Wesley Griffin. All rights reserved. 4 * Copyright (c) 2003 Wesley Griffin. All rights reserved.
@@ -145,11 +145,20 @@ is_numeric_hostname(const char *hostname)
145{ 145{
146 struct addrinfo hints, *ai; 146 struct addrinfo hints, *ai;
147 147
148 /*
149 * We shouldn't ever get a null host but if we do then log an error
150 * and return -1 which stops DNS key fingerprint processing.
151 */
152 if (hostname == NULL) {
153 error("is_numeric_hostname called with NULL hostname");
154 return -1;
155 }
156
148 memset(&hints, 0, sizeof(hints)); 157 memset(&hints, 0, sizeof(hints));
149 hints.ai_socktype = SOCK_DGRAM; 158 hints.ai_socktype = SOCK_DGRAM;
150 hints.ai_flags = AI_NUMERICHOST; 159 hints.ai_flags = AI_NUMERICHOST;
151 160
152 if (getaddrinfo(hostname, "0", &hints, &ai) == 0) { 161 if (getaddrinfo(hostname, NULL, &hints, &ai) == 0) {
153 freeaddrinfo(ai); 162 freeaddrinfo(ai);
154 return -1; 163 return -1;
155 } 164 }
diff --git a/sshconnect.c b/sshconnect.c
index 151299614..0a4bf36b6 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect.c,v 1.204 2008/06/11 21:01:35 grunk Exp $ */ 1/* $OpenBSD: sshconnect.c,v 1.205 2008/06/12 00:03:49 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -221,7 +221,7 @@ ssh_create_socket(int privileged, struct addrinfo *ai)
221 hints.ai_socktype = ai->ai_socktype; 221 hints.ai_socktype = ai->ai_socktype;
222 hints.ai_protocol = ai->ai_protocol; 222 hints.ai_protocol = ai->ai_protocol;
223 hints.ai_flags = AI_PASSIVE; 223 hints.ai_flags = AI_PASSIVE;
224 gaierr = getaddrinfo(options.bind_address, "0", &hints, &res); 224 gaierr = getaddrinfo(options.bind_address, NULL, &hints, &res);
225 if (gaierr) { 225 if (gaierr) {
226 error("getaddrinfo: %s: %s", options.bind_address, 226 error("getaddrinfo: %s: %s", options.bind_address,
227 ssh_gai_strerror(gaierr)); 227 ssh_gai_strerror(gaierr));