diff options
author | tobhe@openbsd.org <tobhe@openbsd.org> | 2019-12-16 13:58:53 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2019-12-20 14:25:08 +1100 |
commit | f65cf1163ff01531ae02f3f9210391d0d692f699 (patch) | |
tree | 3dc82d371462c11bd6116e4240e5e116fe0bed14 /packet.c | |
parent | 57634bfc5708477826c0be265ddc59b9d83e4886 (diff) |
upstream: strdup may return NULL if memory allocation fails. Use
the safer xstrdup which fatals on allocation failures.
ok markus@
OpenBSD-Commit-ID: 8b608d387120630753cbcb8110e0b019c0c9a0d0
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 @@ -530,9 +530,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; } } |