aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2017-11-09 11:41:58 +0100
committerAndreas Schneider <asn@cryptomilk.org>2017-11-09 11:41:58 +0100
commitf525fdb2e189901641ac8d8181bca2b331411bc0 (patch)
tree9a51fc9aa88e7fb15e948aae0cefd9b48d6e3e07 /src
parent01994ea302a1f07ac77bc14f449de0bb6f68cbfd (diff)
downloadlibssh-f525fdb2e189901641ac8d8181bca2b331411bc0.tar.gz
libssh-f525fdb2e189901641ac8d8181bca2b331411bc0.tar.xz
libssh-f525fdb2e189901641ac8d8181bca2b331411bc0.zip
sftp: Check for NULL path and give correct error
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/sftp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sftp.c b/src/sftp.c
index 3b017baf..80870d4e 100644
--- a/src/sftp.c
+++ b/src/sftp.c
@@ -3088,6 +3088,11 @@ static sftp_attributes sftp_xstat(sftp_session sftp, const char *path,
ssh_buffer buffer;
uint32_t id;
+ if (path == NULL) {
+ ssh_set_error_invalid(sftp->session);
+ return NULL;
+ }
+
buffer = ssh_buffer_new();
if (buffer == NULL) {
ssh_set_error_oom(sftp->session);