diff options
author | 2001-03-01 22:46:37 +0000 | |
---|---|---|
committer | 2001-03-01 22:46:37 +0000 | |
commit | c4d233cae96a598ae79474ff8c85dbdb1b563057 (patch) | |
tree | ccf0a402bb01208de8c250e72e7dde49ef253e8b /usr.bin/ssh/ssh.c | |
parent | Fix compilation problems caused by last update (diff) | |
download | wireguard-openbsd-c4d233cae96a598ae79474ff8c85dbdb1b563057.tar.xz wireguard-openbsd-c4d233cae96a598ae79474ff8c85dbdb1b563057.zip |
don't truncate remote ssh-2 commands; from mkubita@securities.cz
use min, not max for logging, fixes overflow.
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r-- | usr.bin/ssh/ssh.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index 48e3935851a..92f85ef0e80 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.99 2001/03/01 02:29:04 deraadt Exp $"); +RCSID("$OpenBSD: ssh.c,v 1.100 2001/03/01 22:46:37 markus Exp $"); #include <openssl/evp.h> #include <openssl/err.h> @@ -918,7 +918,8 @@ client_subsystem_reply(int type, int plen, void *ctxt) id = packet_get_int(); len = buffer_len(&command); - len = MAX(len, 900); + if (len > 900) + len = 900; packet_done(); if (type == SSH2_MSG_CHANNEL_FAILURE) fatal("Request for subsystem '%.*s' failed on channel %d", @@ -991,7 +992,7 @@ ssh_session2_callback(int id, void *arg) debug("Sending command: %.*s", len, buffer_ptr(&command)); channel_request_start(id, "exec", 0); } - packet_put_string(buffer_ptr(&command), len); + packet_put_string(buffer_ptr(&command), buffer_len(&command)); packet_send(); } else { channel_request(id, "shell", 0); |