mirror of
https://github.com/curl/curl.git
synced 2026-04-15 01:11:40 +03:00
conncache: include the zone id in the "bundle" hashkey
Make connections to two separate IPv6 zone ids create separate connections. Reported-by: Harry Sintonen Bug: https://curl.se/docs/CVE-2022-27775.html Closes #8747
This commit is contained in:
parent
852aa5ad35
commit
058f98dc3f
1 changed files with 6 additions and 2 deletions
|
|
@ -155,8 +155,12 @@ static void hashkey(struct connectdata *conn, char *buf,
|
|||
/* report back which name we used */
|
||||
*hostp = hostname;
|
||||
|
||||
/* put the number first so that the hostname gets cut off if too long */
|
||||
msnprintf(buf, len, "%ld%s", port, hostname);
|
||||
/* put the numbers first so that the hostname gets cut off if too long */
|
||||
#ifdef ENABLE_IPV6
|
||||
msnprintf(buf, len, "%u/%ld/%s", conn->scope_id, port, hostname);
|
||||
#else
|
||||
msnprintf(buf, len, "%ld/%s", port, hostname);
|
||||
#endif
|
||||
Curl_strntolower(buf, buf, len);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue