diff options
author | 2015-11-28 06:41:03 +0000 | |
---|---|---|
committer | 2015-11-28 06:41:03 +0000 | |
commit | a1103f8b4e2636f06e8fff64c62de29b5f413f17 (patch) | |
tree | bdfb3e0b8a0f4a29411ddbefa0e47c9261eb81bf /usr.bin/ssh/serverloop.c | |
parent | Oops, left the pledge "tty" active in the previous commited (diff) | |
download | wireguard-openbsd-a1103f8b4e2636f06e8fff64c62de29b5f413f17.tar.xz wireguard-openbsd-a1103f8b4e2636f06e8fff64c62de29b5f413f17.zip |
don't include port number in tcpip-forward replies for requests
that don't allocate a port; bz#2509 diagnosed by Ron Frederick
ok markus
Diffstat (limited to 'usr.bin/ssh/serverloop.c')
-rw-r--r-- | usr.bin/ssh/serverloop.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/serverloop.c b/usr.bin/ssh/serverloop.c index e2f60bc6255..39d2770d5cc 100644 --- a/usr.bin/ssh/serverloop.c +++ b/usr.bin/ssh/serverloop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: serverloop.c,v 1.178 2015/02/20 22:17:21 djm Exp $ */ +/* $OpenBSD: serverloop.c,v 1.179 2015/11/28 06:41:03 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1225,7 +1225,8 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt) free(fwd.listen_host); if ((resp = sshbuf_new()) == NULL) fatal("%s: sshbuf_new", __func__); - if ((r = sshbuf_put_u32(resp, allocated_listen_port)) != 0) + if (allocated_listen_port != 0 && + (r = sshbuf_put_u32(resp, allocated_listen_port)) != 0) fatal("%s: sshbuf_put_u32: %s", __func__, ssh_err(r)); } else if (strcmp(rtype, "cancel-tcpip-forward") == 0) { struct Forward fwd; |