aboutsummaryrefslogtreecommitdiff
path: root/src/channels1.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-06-17 12:39:38 +0200
committerAndreas Schneider <asn@cryptomilk.org>2013-06-17 12:40:35 +0200
commit0ba075e9ce93bfbfa0faf0bd9c14b463bde44782 (patch)
tree499e6f0715624c3e576ab7ecbe234c099bdee2fe /src/channels1.c
parentd93e38bbfe7ab6d84ee064204d2d486342e564ae (diff)
downloadlibssh-0ba075e9ce93bfbfa0faf0bd9c14b463bde44782.tar.gz
libssh-0ba075e9ce93bfbfa0faf0bd9c14b463bde44782.tar.xz
libssh-0ba075e9ce93bfbfa0faf0bd9c14b463bde44782.zip
channels1: Check return value of buffer_add_u8().
Diffstat (limited to 'src/channels1.c')
-rw-r--r--src/channels1.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/channels1.c b/src/channels1.c
index 5d0158d2..62faf4ae 100644
--- a/src/channels1.c
+++ b/src/channels1.c
@@ -288,6 +288,8 @@ SSH_PACKET_CALLBACK(ssh_packet_data1){
SSH_PACKET_CALLBACK(ssh_packet_close1){
ssh_channel channel = ssh_get_channel1(session);
uint32_t status;
+ int rc;
+
(void)type;
(void)user;
@@ -305,7 +307,10 @@ SSH_PACKET_CALLBACK(ssh_packet_close1){
channel->state = SSH_CHANNEL_STATE_CLOSED;
channel->remote_eof = 1;
- buffer_add_u8(session->out_buffer, SSH_CMSG_EXIT_CONFIRMATION);
+ rc = buffer_add_u8(session->out_buffer, SSH_CMSG_EXIT_CONFIRMATION);
+ if (rc < 0) {
+ return SSH_PACKET_NOT_USED;
+ }
packet_send(session);
return SSH_PACKET_USED;