mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +09:00
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:
committed by
Andreas Schneider
parent
83d827d7dd
commit
bda2cc69af
@@ -958,6 +958,10 @@ sftp_dir sftp_opendir(sftp_session sftp, const char *path)
|
|||||||
uint32_t id;
|
uint32_t id;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
if (sftp == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
payload = ssh_buffer_new();
|
payload = ssh_buffer_new();
|
||||||
if (payload == NULL) {
|
if (payload == NULL) {
|
||||||
ssh_set_error_oom(sftp->session);
|
ssh_set_error_oom(sftp->session);
|
||||||
|
|||||||
Reference in New Issue
Block a user