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 <sitter@kde.org>
(cherry picked from commit 97cb302c0e)
This commit is contained in:
Harald Sitter
2018-09-18 15:10:14 +02:00
committed by Andreas Schneider
parent 316a3a42a4
commit 4818cf5606

View File

@@ -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,