diff options
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clientloop.c b/clientloop.c index 8f2f270d7..79aabbe06 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -59,7 +59,7 @@ | |||
59 | */ | 59 | */ |
60 | 60 | ||
61 | #include "includes.h" | 61 | #include "includes.h" |
62 | RCSID("$OpenBSD: clientloop.c,v 1.127 2004/06/17 15:10:13 djm Exp $"); | 62 | RCSID("$OpenBSD: clientloop.c,v 1.128 2004/06/18 11:11:54 djm Exp $"); |
63 | 63 | ||
64 | #include "ssh.h" | 64 | #include "ssh.h" |
65 | #include "ssh1.h" | 65 | #include "ssh1.h" |
@@ -1626,8 +1626,9 @@ client_input_channel_req(int type, u_int32_t seq, void *ctxt) | |||
1626 | debug("client_input_channel_req: channel %d rtype %s reply %d", | 1626 | debug("client_input_channel_req: channel %d rtype %s reply %d", |
1627 | id, rtype, reply); | 1627 | id, rtype, reply); |
1628 | 1628 | ||
1629 | c = channel_lookup(id); | 1629 | if (id == -1) { |
1630 | if (c == NULL) { | 1630 | error("client_input_channel_req: request for channel -1"); |
1631 | } else if ((c = channel_lookup(id)) == NULL) { | ||
1631 | error("client_input_channel_req: channel %d: unknown channel", id); | 1632 | error("client_input_channel_req: channel %d: unknown channel", id); |
1632 | } else if (strcmp(rtype, "exit-status") == 0) { | 1633 | } else if (strcmp(rtype, "exit-status") == 0) { |
1633 | exitval = packet_get_int(); | 1634 | exitval = packet_get_int(); |
@@ -1646,7 +1647,7 @@ client_input_channel_req(int type, u_int32_t seq, void *ctxt) | |||
1646 | if (reply) { | 1647 | if (reply) { |
1647 | packet_start(success ? | 1648 | packet_start(success ? |
1648 | SSH2_MSG_CHANNEL_SUCCESS : SSH2_MSG_CHANNEL_FAILURE); | 1649 | SSH2_MSG_CHANNEL_SUCCESS : SSH2_MSG_CHANNEL_FAILURE); |
1649 | packet_put_int(c->remote_id); | 1650 | packet_put_int(id); |
1650 | packet_send(); | 1651 | packet_send(); |
1651 | } | 1652 | } |
1652 | xfree(rtype); | 1653 | xfree(rtype); |