openssl: associate/detach the transfer from connection

CVE-2021-22901

Bug: https://curl.se/docs/CVE-2021-22901.html
This commit is contained in:
Harry Sintonen 2021-05-05 13:42:26 +02:00 committed by Daniel Stenberg
parent 39ce47f219
commit 7f4a9a9b2a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
13 changed files with 172 additions and 50 deletions

View file

@ -878,8 +878,10 @@ bool Curl_multiplex_wanted(const struct Curl_multi *multi)
void Curl_detach_connnection(struct Curl_easy *data)
{
struct connectdata *conn = data->conn;
if(conn)
if(conn) {
Curl_llist_remove(&conn->easyq, &data->conn_queue, NULL);
Curl_ssl_detach_conn(data, conn);
}
data->conn = NULL;
}
@ -898,6 +900,7 @@ void Curl_attach_connnection(struct Curl_easy *data,
&data->conn_queue);
if(conn->handler->attach)
conn->handler->attach(data, conn);
Curl_ssl_associate_conn(data, conn);
}
static int waitconnect_getsock(struct connectdata *conn,