summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-03-05 06:52:57 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-03-05 06:52:57 +0000
commit4040fe10a9fb735bf75670522d11408ee654f74d (patch)
tree617770678c1374ae3b1c56ebe423ede7ab9db3f0 /ssh.c
parentb22c2b86af40ed58621781f4ea0b3223542bcd80 (diff)
- markus@cvs.openbsd.org 2001/03/01 22:46:37
[ssh.c] don't truncate remote ssh-2 commands; from mkubita@securities.cz use min, not max for logging, fixes overflow.
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ssh.c b/ssh.c
index cf6b03796..c76c7bb71 100644
--- a/ssh.c
+++ b/ssh.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: ssh.c,v 1.99 2001/03/01 02:29:04 deraadt Exp $"); 42RCSID("$OpenBSD: ssh.c,v 1.100 2001/03/01 22:46:37 markus Exp $");
43 43
44#include <openssl/evp.h> 44#include <openssl/evp.h>
45#include <openssl/err.h> 45#include <openssl/err.h>
@@ -936,7 +936,8 @@ client_subsystem_reply(int type, int plen, void *ctxt)
936 936
937 id = packet_get_int(); 937 id = packet_get_int();
938 len = buffer_len(&command); 938 len = buffer_len(&command);
939 len = MAX(len, 900); 939 if (len > 900)
940 len = 900;
940 packet_done(); 941 packet_done();
941 if (type == SSH2_MSG_CHANNEL_FAILURE) 942 if (type == SSH2_MSG_CHANNEL_FAILURE)
942 fatal("Request for subsystem '%.*s' failed on channel %d", 943 fatal("Request for subsystem '%.*s' failed on channel %d",
@@ -1009,7 +1010,7 @@ ssh_session2_callback(int id, void *arg)
1009 debug("Sending command: %.*s", len, buffer_ptr(&command)); 1010 debug("Sending command: %.*s", len, buffer_ptr(&command));
1010 channel_request_start(id, "exec", 0); 1011 channel_request_start(id, "exec", 0);
1011 } 1012 }
1012 packet_put_string(buffer_ptr(&command), len); 1013 packet_put_string(buffer_ptr(&command), buffer_len(&command));
1013 packet_send(); 1014 packet_send();
1014 } else { 1015 } else {
1015 channel_request(id, "shell", 0); 1016 channel_request(id, "shell", 0);