diff --git a/src/sftpserver.c b/src/sftpserver.c index b639a2ce..9117f155 100644 --- a/src/sftpserver.c +++ b/src/sftpserver.c @@ -73,9 +73,14 @@ sftp_client_message sftp_get_client_message(sftp_session sftp) { return NULL; } - ssh_buffer_add_data(msg->complete_message, - ssh_buffer_get(payload), - ssh_buffer_get_len(payload)); + rc = ssh_buffer_add_data(msg->complete_message, + ssh_buffer_get(payload), + ssh_buffer_get_len(payload)); + if (rc < 0) { + ssh_set_error_oom(session); + sftp_client_message_free(msg); + return NULL; + } ssh_buffer_get_u32(payload, &msg->id);