aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-07-23 18:34:25 +0200
committerAndreas Schneider <mail@cynapses.org>2009-07-23 18:34:25 +0200
commit9450a3c9874137d316b78a11d5ae21b887b9f1b2 (patch)
tree2b1edbe64c5d3acee625f3079c0fcb96bc37f834
parent1939a55c3cae415ae295134d54e34a2daec43438 (diff)
downloadlibssh-9450a3c9874137d316b78a11d5ae21b887b9f1b2.tar.gz
libssh-9450a3c9874137d316b78a11d5ae21b887b9f1b2.tar.xz
libssh-9450a3c9874137d316b78a11d5ae21b887b9f1b2.zip
Fix a possible segfault in sftp_canonicalize_path().
-rw-r--r--libssh/sftp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libssh/sftp.c b/libssh/sftp.c
index fa8e1214..790984aa 100644
--- a/libssh/sftp.c
+++ b/libssh/sftp.c
@@ -2223,6 +2223,10 @@ char *sftp_canonicalize_path(SFTP_SESSION *sftp, const char *path) {
u32 ignored;
u32 id;
+ if (sftp == NULL || path == NULL) {
+ return NULL;
+ }
+
buffer = buffer_new();
if (buffer == NULL) {
return NULL;