Skip to content

Commit

Permalink
libssh2: fix crash in keyboard callback
Browse files Browse the repository at this point in the history
- Always set the libssh2 'abstract' user-pointer to the libcurl easy
  handle associated with the ssh session, so it is always passed to the
  ssh keyboard callback.

Prior to this change and since 8b5f100 (precedes curl 8.0.0), if libcurl
was built without CURL_DEBUG then it could crash during the ssh auth
phase due to a null dereference in the ssh keyboard callback.

Reported-by: Andreas Falkenhahn

Fixes curl#11024
Closes #xxxx
  • Loading branch information
jay committed Apr 25, 2023
1 parent 3f0b81c commit 4fada94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/vssh/libssh2.c
Expand Up @@ -3274,7 +3274,7 @@ static CURLcode ssh_connect(struct Curl_easy *data, bool *done)
my_libssh2_free,
my_libssh2_realloc, data);
#else
sshc->ssh_session = libssh2_session_init();
sshc->ssh_session = libssh2_session_init_ex(NULL, NULL, NULL, data);
#endif
if(!sshc->ssh_session) {
failf(data, "Failure initialising ssh session");
Expand Down

0 comments on commit 4fada94

Please sign in to comment.