From e2186933c12f86abffcc86f9c65c74fa35da0c52 Mon Sep 17 00:00:00 2001 From: Harry Sintonen Date: Sat, 21 Mar 2026 17:17:57 +0200 Subject: [PATCH] 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 --- src/tool_libinfo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tool_libinfo.c b/src/tool_libinfo.c index 634b8c4fe1..adcc0c4212 100644 --- a/src/tool_libinfo.c +++ b/src/tool_libinfo.c @@ -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; }