Curl_easy: remember last connection by id, not by pointer

CVE-2020-8231

Bug: https://curl.haxx.se/docs/CVE-2020-8231.html

Reported-by: Marc Aldorasi
Closes #5824
This commit is contained in:
Daniel Stenberg 2020-08-16 11:34:35 +02:00
parent 687908c6e6
commit 3c9e021f86
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 18 additions and 17 deletions

View file

@ -1300,7 +1300,7 @@ struct UrlState {
/* buffers to store authentication data in, as parsed from input options */
struct curltime keeps_speed; /* for the progress meter really */
struct connectdata *lastconnect; /* The last connection, NULL if undefined */
long lastconnect_id; /* The last connection, -1 if undefined */
struct dynbuf headerb; /* buffer to store headers in */
char *buffer; /* download buffer */