mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-29 08:44:52 +02:00
upstream: initialize cname in case ai_canonname is NULL or too
long; ok djm OpenBSD-Commit-ID: c27984636fdb1035d1642283664193e91aab6e37
This commit is contained in:
parent
a6134b02b5
commit
31f1ee5496
5
ssh.c
5
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@cs.hut.fi>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* Copyright (c) 1995 Tatu Ylonen <ylo@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)
|
if (port <= 0)
|
||||||
port = default_ssh_port();
|
port = default_ssh_port();
|
||||||
|
if (cname != NULL)
|
||||||
|
*cname = '\0';
|
||||||
|
|
||||||
snprintf(strport, sizeof strport, "%d", port);
|
snprintf(strport, sizeof strport, "%d", port);
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
@ -477,7 +479,6 @@ resolve_canonicalize(char **hostp, int port)
|
|||||||
}
|
}
|
||||||
/* Attempt each supplied suffix */
|
/* Attempt each supplied suffix */
|
||||||
for (i = 0; i < options.num_canonical_domains; i++) {
|
for (i = 0; i < options.num_canonical_domains; i++) {
|
||||||
*newname = '\0';
|
|
||||||
xasprintf(&fullhost, "%s.%s.", *hostp,
|
xasprintf(&fullhost, "%s.%s.", *hostp,
|
||||||
options.canonical_domains[i]);
|
options.canonical_domains[i]);
|
||||||
debug3("%s: attempting \"%s\" => \"%s\"", __func__,
|
debug3("%s: attempting \"%s\" => \"%s\"", __func__,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user