1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

channels: Check return of ssh_buffer_unpack()

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-09-25 15:23:46 +02:00
parent 480915c07d
commit 253bda4bac

View File

@@ -683,6 +683,10 @@ SSH_PACKET_CALLBACK(channel_rcv_request) {
if (strcmp(request,"exit-status") == 0) {
SAFE_FREE(request);
rc = ssh_buffer_unpack(packet, "d", &channel->exit_status);
if (rc != SSH_OK) {
SSH_LOG(SSH_LOG_PACKET, "Invalid exit-status packet");
return SSH_PACKET_USED;
}
SSH_LOG(SSH_LOG_PACKET, "received exit-status %d", channel->exit_status);
ssh_callbacks_execute_list(channel->callbacks,