sftp: Add NULL check in sftp_opendir()

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Anderson Toshiyuki Sasaki
2018-12-03 18:02:33 +01:00
committed by Andreas Schneider
parent 83d827d7dd
commit bda2cc69af

View File

@@ -958,6 +958,10 @@ sftp_dir sftp_opendir(sftp_session sftp, const char *path)
uint32_t id;
int rc;
if (sftp == NULL) {
return NULL;
}
payload = ssh_buffer_new();
if (payload == NULL) {
ssh_set_error_oom(sftp->session);