New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix NULL pointer access #11024
Fix NULL pointer access #11024
Conversation
We need to check against NULL here because it can be called before `ssh_attach` stuffs the easy handle into the session's abstract storage.
How come this has never been an issue before? Shouldn't data always be valid there? The only way I can see this happening is the "abstract" (user-supplied pointer) parameter was NULL the last time it was set, and AFAICT we only set abstract on init when CURL_DEBUG but I'm not sure why: Lines 3272 to 3278 in b16d1fa
Edit: Looks like 8b5f100 is biting us. |
- 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
Closing in favor of #11026. @afalkenhahn please test |
I can confirm that #11026 fixes the issue. |
- 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 #11024 Closes #11026
Thanks |
We need to check against NULL here because
kbd_callback
can be called beforessh_attach
stuffs the easy handle into the session's abstract storage.