← Commit list

7e450cb80a

Daniel Stenberg
Daniel Stenberg
2026-04-16
SUCCESS Duration: 250s

Subject

libssh2: allocate libssh2-friendly memory in kbd_callback

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/vssh/libssh2.c+3 -1
@@ -148,7 +148,9 @@ static void kbd_callback(const char *name, int name_len,
#endif /* CURL_LIBSSH2_DEBUG */
if(num_prompts == 1) {
struct connectdata *conn = data->conn;
- responses[0].text = curlx_strdup(conn->passwd);
+ /* this function must allocate memory that can be freed by libssh2, which
+ uses the LIBSSH2_FREE_FUNC callback */
+ responses[0].text = Curl_cstrdup(conn->passwd);
responses[0].length =
responses[0].text == NULL ? 0 : curlx_uztoui(strlen(conn->passwd));
}