[openssh-commits] [openssh] 09/22: upstream: initialize cname in case ai_canonname is NULL or too

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Mar 13 13:18:46 AEDT 2020


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 31f1ee54968ad84eb32375e4412e0318766b586b
Author: markus at openbsd.org <markus at openbsd.org>
Date:   Fri Mar 6 18:20:02 2020 +0000

    upstream: initialize cname in case ai_canonname is NULL or too
    
    long; ok djm
    
    OpenBSD-Commit-ID: c27984636fdb1035d1642283664193e91aab6e37
---
 ssh.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ssh.c b/ssh.c
index a983a108..9713b61e 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.520 2020/02/18 08:49:49 dtucker Exp $ */
+/* $OpenBSD: ssh.c,v 1.521 2020/03/06 18:20:02 markus Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -248,6 +248,8 @@ resolve_host(const char *name, int port, int logerr, char *cname, size_t clen)
 
 	if (port <= 0)
 		port = default_ssh_port();
+	if (cname != NULL)
+		*cname = '\0';
 
 	snprintf(strport, sizeof strport, "%d", port);
 	memset(&hints, 0, sizeof(hints));
@@ -477,7 +479,6 @@ resolve_canonicalize(char **hostp, int port)
 	}
 	/* Attempt each supplied suffix */
 	for (i = 0; i < options.num_canonical_domains; i++) {
-		*newname = '\0';
 		xasprintf(&fullhost, "%s.%s.", *hostp,
 		    options.canonical_domains[i]);
 		debug3("%s: attempting \"%s\" => \"%s\"", __func__,

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list