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:
Harry Sintonen 2026-03-21 17:17:57 +02:00 committed by Viktor Szakats
parent 8fce3e17e6
commit e2186933c1
No known key found for this signature in database

View File

@ -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;
}