mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 20:30:38 +09:00
sftpserver: Add missing NULL check for ssh_buffer_new()
Thanks to Ramin Farajpour Cami for spotting this. Fixes T232 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
@@ -67,6 +67,12 @@ sftp_client_message sftp_get_client_message(sftp_session sftp) {
|
||||
|
||||
/* take a copy of the whole packet */
|
||||
msg->complete_message = ssh_buffer_new();
|
||||
if (msg->complete_message == NULL) {
|
||||
ssh_set_error_oom(session);
|
||||
sftp_client_message_free(msg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ssh_buffer_add_data(msg->complete_message,
|
||||
ssh_buffer_get(payload),
|
||||
ssh_buffer_get_len(payload));
|
||||
|
||||
Reference in New Issue
Block a user