diff options
author | 2019-11-27 03:34:04 +0000 | |
---|---|---|
committer | 2019-11-27 03:34:04 +0000 | |
commit | 2bf2fb2b36b856abf1b449904be5f12dfb9c45fc (patch) | |
tree | 894cc457444c56bf047ed274f87158ab91237918 /usr.bin/ssh/serverloop.c | |
parent | Document ILOM command to reset hardware (diff) | |
download | wireguard-openbsd-2bf2fb2b36b856abf1b449904be5f12dfb9c45fc.tar.xz wireguard-openbsd-2bf2fb2b36b856abf1b449904be5f12dfb9c45fc.zip |
Make channel_id u_int32_t and remove unnecessary check and cast that were
left over from the type conversion. Noted by t-hashida@amiya.co.jp in
bz#3098, ok markus@ djm@
Diffstat (limited to 'usr.bin/ssh/serverloop.c')
-rw-r--r-- | usr.bin/ssh/serverloop.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/ssh/serverloop.c b/usr.bin/ssh/serverloop.c index 33c81feafed..1e558c651a8 100644 --- a/usr.bin/ssh/serverloop.c +++ b/usr.bin/ssh/serverloop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: serverloop.c,v 1.216 2019/06/28 13:35:04 deraadt Exp $ */ +/* $OpenBSD: serverloop.c,v 1.217 2019/11/27 03:34:04 dtucker Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -665,7 +665,7 @@ server_input_channel_open(int type, u_int32_t seq, struct ssh *ssh) char *ctype = NULL; const char *errmsg = NULL; int r, reason = SSH2_OPEN_CONNECT_FAILED; - u_int rchan = 0, rmaxpack = 0, rwindow = 0; + u_int32_t rchan = 0, rmaxpack = 0, rwindow = 0; if ((r = sshpkt_get_cstring(ssh, &ctype, NULL)) != 0 || (r = sshpkt_get_u32(ssh, &rchan)) != 0 || @@ -673,11 +673,9 @@ server_input_channel_open(int type, u_int32_t seq, struct ssh *ssh) (r = sshpkt_get_u32(ssh, &rmaxpack)) != 0) sshpkt_fatal(ssh, r, "%s: parse packet", __func__); debug("%s: ctype %s rchan %u win %u max %u", __func__, - ctype, rchan, rwindow, rmaxpack); + ctype, (u_int)rchan, (u_int)rwindow, (u_int)rmaxpack); - if (rchan > INT_MAX) { - error("%s: invalid remote channel ID", __func__); - } else if (strcmp(ctype, "session") == 0) { + if (strcmp(ctype, "session") == 0) { c = server_request_session(ssh); } else if (strcmp(ctype, "direct-tcpip") == 0) { c = server_request_direct_tcpip(ssh, &reason, &errmsg); @@ -688,7 +686,7 @@ server_input_channel_open(int type, u_int32_t seq, struct ssh *ssh) } if (c != NULL) { debug("%s: confirm %s", __func__, ctype); - c->remote_id = (int)rchan; + c->remote_id = rchan; c->have_remote_id = 1; c->remote_window = rwindow; c->remote_maxpacket = rmaxpack; |