cookie: compare path case sensitively

Verify with test 1645

Reported-by: Joshua Rogers
Closes #21616
This commit is contained in:
Daniel Stenberg 2026-05-14 23:46:45 +02:00
parent 71430e87fd
commit a15cfeb100
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 76 additions and 3 deletions

View file

@ -854,7 +854,7 @@ static bool replace_existing(struct Curl_easy *data,
else
cllen = strlen(clist->path);
if(curl_strnequal(clist->path, co->path, cllen)) {
if(!strncmp(clist->path, co->path, cllen)) {
infof(data, "cookie '%s' for domain '%s' dropped, would "
"overlay an existing cookie", co->name, co->domain);
return FALSE;
@ -878,7 +878,7 @@ static bool replace_existing(struct Curl_easy *data,
/* the domains were identical */
if(clist->path && co->path &&
!curl_strequal(clist->path, co->path))
strcmp(clist->path, co->path))
replace_old = FALSE;
else if(!clist->path != !co->path)
replace_old = FALSE;