diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2012-12-03 12:35:36 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2012-12-03 12:35:36 +0100 |
commit | ab8c7de6f8946f24d66f7d187aef191a9efef1fd (patch) | |
tree | 7c542e6a39c30b82dd7b32eefb7c158fa2f45b9a | |
parent | cd4e28e7c804918b6e10d9e947c198259384d151 (diff) | |
download | libssh-ab8c7de6f8946f24d66f7d187aef191a9efef1fd.tar.gz libssh-ab8c7de6f8946f24d66f7d187aef191a9efef1fd.tar.xz libssh-ab8c7de6f8946f24d66f7d187aef191a9efef1fd.zip |
BUG 94: Fix big endian issue.
-rw-r--r-- | src/channels.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/channels.c b/src/channels.c index 1a0baf19..13d6d302 100644 --- a/src/channels.c +++ b/src/channels.c @@ -653,7 +653,7 @@ SSH_PACKET_CALLBACK(channel_rcv_request) { ssh_channel channel; ssh_string request_s; char *request; - uint32_t status; + uint8_t status; int rc; (void)user; (void)type; @@ -684,9 +684,11 @@ SSH_PACKET_CALLBACK(channel_rcv_request) { buffer_get_u8(packet, (uint8_t *) &status); if (strcmp(request,"exit-status") == 0) { + uint32_t exit_status = 0; + SAFE_FREE(request); - buffer_get_u32(packet, &status); - channel->exit_status = ntohl(status); + buffer_get_u32(packet, &exit_status); + channel->exit_status = ntohl(exit_status); ssh_log(session, SSH_LOG_PACKET, "received exit-status %d", channel->exit_status); if(ssh_callbacks_exists(channel->callbacks, channel_exit_status_function)) { |