mirror of
https://github.com/curl/curl.git
synced 2026-07-25 06:27:16 +03:00
cookie: fix crash in netscape cookie parsing
- Parse the input string without modifying it. Prior to this change a segfault could occur if the input string was const because the tokenizer modified the input string. For example if the user set CURLOPT_COOKIELIST to a const string then libcurl would likely cause a crash when modifying that string. Even if the string was not const or a crash did not occur there was still the incorrect and unexpected modification of the user's input string. This issue was caused by30da1f59(precedes 8.11.0) which refactored some options parsing and eliminated the copy of the input string. Also, an earlier commitf88cc654incorrectly cast the input pointer when passing it to strtok. Co-authored-by: Daniel Stenberg Closes https://github.com/curl/curl/pull/15826
This commit is contained in:
parent
fabfa8e402
commit
39e21794a7
6 changed files with 157 additions and 29 deletions
|
|
@ -81,7 +81,7 @@ NULL
|
|||
|
||||
int main(void)
|
||||
{
|
||||
char *my_cookie =
|
||||
const char *my_cookie =
|
||||
"example.com" /* Hostname */
|
||||
SEP "FALSE" /* Include subdomains */
|
||||
SEP "/" /* Path */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue