From eaa97d20620d6b2a557f1ef390fd32723c027f18 Mon Sep 17 00:00:00 2001 From: Anderson Toshiyuki Sasaki Date: Tue, 4 Dec 2018 15:16:41 +0100 Subject: [PATCH] sftp: Add NULL check in sftp_xstat() Signed-off-by: Anderson Toshiyuki Sasaki Reviewed-by: Andreas Schneider --- src/sftp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sftp.c b/src/sftp.c index 5b73910d..9c8712ab 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -3239,6 +3239,10 @@ static sftp_attributes sftp_xstat(sftp_session sftp, uint32_t id; int rc; + if (sftp == NULL) { + return NULL; + } + if (path == NULL) { ssh_set_error_invalid(sftp->session); sftp_set_error(sftp, SSH_FX_FAILURE);