mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
channels: Check return of ssh_buffer_unpack()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -683,6 +683,10 @@ SSH_PACKET_CALLBACK(channel_rcv_request) {
|
|||||||
if (strcmp(request,"exit-status") == 0) {
|
if (strcmp(request,"exit-status") == 0) {
|
||||||
SAFE_FREE(request);
|
SAFE_FREE(request);
|
||||||
rc = ssh_buffer_unpack(packet, "d", &channel->exit_status);
|
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_LOG(SSH_LOG_PACKET, "received exit-status %d", channel->exit_status);
|
||||||
|
|
||||||
ssh_callbacks_execute_list(channel->callbacks,
|
ssh_callbacks_execute_list(channel->callbacks,
|
||||||
|
|||||||
Reference in New Issue
Block a user