From 9450a3c9874137d316b78a11d5ae21b887b9f1b2 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 23 Jul 2009 18:34:25 +0200 Subject: Fix a possible segfault in sftp_canonicalize_path(). --- libssh/sftp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libssh/sftp.c') 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; -- cgit v1.2.3