mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
tool: add check for curlinfo->age when determining if ssh backend is libssh2
The code failed to check for the version, and could thus read memory past the existing curl_version_info_data structure. This could lead to a crash. Closes #21050
This commit is contained in:
parent
8fce3e17e6
commit
e2186933c1
@ -184,7 +184,8 @@ CURLcode get_libcurl_info(void)
|
||||
++feature_count;
|
||||
}
|
||||
|
||||
feature_libssh2 = curlinfo->libssh_version &&
|
||||
feature_libssh2 = curlinfo->age >= CURLVERSION_FOURTH &&
|
||||
curlinfo->libssh_version &&
|
||||
!strncmp("libssh2", curlinfo->libssh_version, 7);
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user