diff options
author | Anderson Toshiyuki Sasaki <ansasaki@redhat.com> | 2018-12-03 18:02:33 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-12-07 17:47:11 +0100 |
commit | bda2cc69af0e8b7446b91c05b2eb9c242701fb45 (patch) | |
tree | e64ca36d5c1c4d1df720b00ad957d011c503a9e1 | |
parent | 83d827d7dd0e382969f57525a13954114ddf5c22 (diff) | |
download | libssh-bda2cc69af0e8b7446b91c05b2eb9c242701fb45.tar.gz libssh-bda2cc69af0e8b7446b91c05b2eb9c242701fb45.tar.xz libssh-bda2cc69af0e8b7446b91c05b2eb9c242701fb45.zip |
sftp: Add NULL check in sftp_opendir()
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r-- | src/sftp.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); |