From: Daniel Stenberg Date: Mon, 8 May 2023 12:33:54 +0000 (+0200) Subject: [PATCH] libssh2: free fingerprint better X-Git-Tag: archive/raspbian/7.88.1-10+rpi1+deb12u1^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c8c076a0a0cbd35b20833d8d9c77be5bdd5bc32c;p=curl.git [PATCH] libssh2: free fingerprint better Reported-by: Wei Chong Tan Closes #11088 Gbp-Pq: Name CVE-2023-28319.patch --- diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 4703eb57..c5bbdd1f 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -723,11 +723,10 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data) */ if((pub_pos != b64_pos) || strncmp(fingerprint_b64, pubkey_sha256, pub_pos)) { - free(fingerprint_b64); - failf(data, "Denied establishing ssh session: mismatch sha256 fingerprint. " "Remote %s is not equal to %s", fingerprint_b64, pubkey_sha256); + free(fingerprint_b64); state(data, SSH_SESSION_FREE); sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION; return sshc->actualcode;