summaryrefslogtreecommitdiffstats
path: root/clientloop.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2004-06-18 22:23:22 +1000
committerDamien Miller <djm@mindrot.org>2004-06-18 22:23:22 +1000
commit3bbd878c2ec2b337b9e5b9455e0a2bd1902a0824 (patch)
treeb5d4eae0c95ab46b30b41f3f2f4611d8816adfda /clientloop.c
parentb8ea24868f0347ea6d5116cbd93197c1ab0e942b (diff)
- djm@cvs.openbsd.org 2004/06/18 11:11:54
[channels.c clientloop.c] Don't explode in clientloop when we receive a bogus channel id, but also don't generate them to begin with; ok markus@
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/clientloop.c b/clientloop.c
index 8f2f270d..79aabbe0 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -59,7 +59,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: clientloop.c,v 1.127 2004/06/17 15:10:13 djm Exp $");
+RCSID("$OpenBSD: clientloop.c,v 1.128 2004/06/18 11:11:54 djm Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -1626,8 +1626,9 @@ client_input_channel_req(int type, u_int32_t seq, void *ctxt)
debug("client_input_channel_req: channel %d rtype %s reply %d",
id, rtype, reply);
- c = channel_lookup(id);
- if (c == NULL) {
+ if (id == -1) {
+ error("client_input_channel_req: request for channel -1");
+ } else if ((c = channel_lookup(id)) == NULL) {
error("client_input_channel_req: channel %d: unknown channel", id);
} else if (strcmp(rtype, "exit-status") == 0) {
exitval = packet_get_int();
@@ -1646,7 +1647,7 @@ client_input_channel_req(int type, u_int32_t seq, void *ctxt)
if (reply) {
packet_start(success ?
SSH2_MSG_CHANNEL_SUCCESS : SSH2_MSG_CHANNEL_FAILURE);
- packet_put_int(c->remote_id);
+ packet_put_int(id);
packet_send();
}
xfree(rtype);