summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/packet.c
diff options
context:
space:
mode:
authortobhe <tobhe@openbsd.org>2019-12-16 13:58:53 +0000
committertobhe <tobhe@openbsd.org>2019-12-16 13:58:53 +0000
commit43e343f8aa17502e68dbb74fa3dd463280c74fe5 (patch)
tree328404629833eaa99ce5c7c5814e25329366aad3 /usr.bin/ssh/packet.c
parentWhen rsync exits non zero because of network issues or because the (diff)
downloadwireguard-openbsd-43e343f8aa17502e68dbb74fa3dd463280c74fe5.tar.xz
wireguard-openbsd-43e343f8aa17502e68dbb74fa3dd463280c74fe5.zip
strdup may return NULL if memory allocation fails. Use the safer xstrdup
which fatals on allocation failures. ok markus@
Diffstat (limited to 'usr.bin/ssh/packet.c')
-rw-r--r--usr.bin/ssh/packet.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c
index a0e4f8e243d..9a3dda208fb 100644
--- a/usr.bin/ssh/packet.c
+++ b/usr.bin/ssh/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.286 2019/06/28 13:35:04 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.287 2019/12/16 13:58:53 tobhe Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -505,9 +505,9 @@ ssh_remote_ipaddr(struct ssh *ssh)
ssh->local_ipaddr = get_local_ipaddr(sock);
ssh->local_port = get_local_port(sock);
} else {
- ssh->remote_ipaddr = strdup("UNKNOWN");
+ ssh->remote_ipaddr = xstrdup("UNKNOWN");
ssh->remote_port = 65535;
- ssh->local_ipaddr = strdup("UNKNOWN");
+ ssh->local_ipaddr = xstrdup("UNKNOWN");
ssh->local_port = 65535;
}
}