1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-05-28 17:41:28 +03:00

sftp: Fix a possible null pointer dereference in sftp_async_read.

This commit is contained in:
Andreas Schneider 2012-10-07 22:03:35 +02:00
parent b811b89f57
commit ff53664f54

View File

@ -1834,13 +1834,18 @@ int sftp_async_read_begin(sftp_file file, uint32_t len){
/* Wait for an asynchronous read to complete and save the data. */ /* Wait for an asynchronous read to complete and save the data. */
int sftp_async_read(sftp_file file, void *data, uint32_t size, uint32_t id){ int sftp_async_read(sftp_file file, void *data, uint32_t size, uint32_t id){
sftp_session sftp = file->sftp; sftp_session sftp;
sftp_message msg = NULL; sftp_message msg = NULL;
sftp_status_message status; sftp_status_message status;
ssh_string datastring; ssh_string datastring;
int err = SSH_OK; int err = SSH_OK;
uint32_t len; uint32_t len;
if (file == NULL) {
return SSH_ERROR;
}
sftp = file->sftp;
if (file->eof) { if (file->eof) {
return 0; return 0;
} }