From 97cb302c0ea43788a78853f8fd4a8bfa066191a3 Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Tue, 18 Sep 2018 15:10:14 +0200 Subject: [PATCH] sftp: fix buffer_unpack argument to be char** rather than char* Summary: buffer variable 's' gets unpacked as char**, the previous code was passing a char* causing segfaults on all readlink calls inside the unpacking code Test Plan: - without patchy examples/samplesftp segfaults in readlink - with patchy it doesn't Reviewers: asn Differential Revision: https://bugs.libssh.org/D14 Signed-off-by: Harald Sitter --- src/sftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sftp.c b/src/sftp.c index 247e6b9c..47207995 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -2697,7 +2697,7 @@ char *sftp_readlink(sftp_session sftp, const char *path) rc = ssh_buffer_unpack(msg->payload, "ds", &ignored, - lnk); + &lnk); sftp_message_free(msg); if (rc != SSH_OK) { ssh_set_error(sftp->session,