diff --git a/src/sftp.c b/src/sftp.c index 9c8712ab..1fd2f4bc 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -3323,6 +3323,10 @@ sftp_attributes sftp_fstat(sftp_file file) uint32_t id; int rc; + if (file == NULL) { + return NULL; + } + buffer = ssh_buffer_new(); if (buffer == NULL) { ssh_set_error_oom(file->sftp->session);