summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auth.c14
-rw-r--r--packet.c6
2 files changed, 10 insertions, 10 deletions
diff --git a/auth.c b/auth.c
index 0a46e1d8a..48838508e 100644
--- a/auth.c
+++ b/auth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth.c,v 1.143 2019/11/25 00:54:23 djm Exp $ */ 1/* $OpenBSD: auth.c,v 1.144 2019/12/16 13:58:53 tobhe Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -748,7 +748,7 @@ remote_hostname(struct ssh *ssh)
748 if (getpeername(ssh_packet_get_connection_in(ssh), 748 if (getpeername(ssh_packet_get_connection_in(ssh),
749 (struct sockaddr *)&from, &fromlen) == -1) { 749 (struct sockaddr *)&from, &fromlen) == -1) {
750 debug("getpeername failed: %.100s", strerror(errno)); 750 debug("getpeername failed: %.100s", strerror(errno));
751 return strdup(ntop); 751 return xstrdup(ntop);
752 } 752 }
753 753
754 ipv64_normalise_mapped(&from, &fromlen); 754 ipv64_normalise_mapped(&from, &fromlen);
@@ -760,7 +760,7 @@ remote_hostname(struct ssh *ssh)
760 if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name), 760 if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name),
761 NULL, 0, NI_NAMEREQD) != 0) { 761 NULL, 0, NI_NAMEREQD) != 0) {
762 /* Host name not found. Use ip address. */ 762 /* Host name not found. Use ip address. */
763 return strdup(ntop); 763 return xstrdup(ntop);
764 } 764 }
765 765
766 /* 766 /*
@@ -775,7 +775,7 @@ remote_hostname(struct ssh *ssh)
775 logit("Nasty PTR record \"%s\" is set up for %s, ignoring", 775 logit("Nasty PTR record \"%s\" is set up for %s, ignoring",
776 name, ntop); 776 name, ntop);
777 freeaddrinfo(ai); 777 freeaddrinfo(ai);
778 return strdup(ntop); 778 return xstrdup(ntop);
779 } 779 }
780 780
781 /* Names are stored in lowercase. */ 781 /* Names are stored in lowercase. */
@@ -796,7 +796,7 @@ remote_hostname(struct ssh *ssh)
796 if (getaddrinfo(name, NULL, &hints, &aitop) != 0) { 796 if (getaddrinfo(name, NULL, &hints, &aitop) != 0) {
797 logit("reverse mapping checking getaddrinfo for %.700s " 797 logit("reverse mapping checking getaddrinfo for %.700s "
798 "[%s] failed.", name, ntop); 798 "[%s] failed.", name, ntop);
799 return strdup(ntop); 799 return xstrdup(ntop);
800 } 800 }
801 /* Look for the address from the list of addresses. */ 801 /* Look for the address from the list of addresses. */
802 for (ai = aitop; ai; ai = ai->ai_next) { 802 for (ai = aitop; ai; ai = ai->ai_next) {
@@ -811,9 +811,9 @@ remote_hostname(struct ssh *ssh)
811 /* Address not found for the host name. */ 811 /* Address not found for the host name. */
812 logit("Address %.100s maps to %.600s, but this does not " 812 logit("Address %.100s maps to %.600s, but this does not "
813 "map back to the address.", ntop, name); 813 "map back to the address.", ntop, name);
814 return strdup(ntop); 814 return xstrdup(ntop);
815 } 815 }
816 return strdup(name); 816 return xstrdup(name);
817} 817}
818 818
819/* 819/*
diff --git a/packet.c b/packet.c
index 7a703d695..2b50ef415 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.c,v 1.286 2019/06/28 13:35:04 deraadt Exp $ */ 1/* $OpenBSD: packet.c,v 1.287 2019/12/16 13:58:53 tobhe 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
@@ -530,9 +530,9 @@ ssh_remote_ipaddr(struct ssh *ssh)
530 ssh->local_ipaddr = get_local_ipaddr(sock); 530 ssh->local_ipaddr = get_local_ipaddr(sock);
531 ssh->local_port = get_local_port(sock); 531 ssh->local_port = get_local_port(sock);
532 } else { 532 } else {
533 ssh->remote_ipaddr = strdup("UNKNOWN"); 533 ssh->remote_ipaddr = xstrdup("UNKNOWN");
534 ssh->remote_port = 65535; 534 ssh->remote_port = 65535;
535 ssh->local_ipaddr = strdup("UNKNOWN"); 535 ssh->local_ipaddr = xstrdup("UNKNOWN");
536 ssh->local_port = 65535; 536 ssh->local_port = 65535;
537 } 537 }
538 } 538 }