mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
transfer: clear the URL pointer in OOM to avoid UAF
Since the pointer can be extracted with CURLINFO_EFFECTIVE_URL later it must not linger pointing to freed memory. Found by Codex Security Closes #21123
This commit is contained in:
parent
28fbf4a87d
commit
86b39c2226
@ -469,6 +469,8 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
|
||||
uc = curl_url_get(data->set.uh,
|
||||
CURLUPART_URL, &data->set.str[STRING_SET_URL], 0);
|
||||
if(uc) {
|
||||
/* clear the pointer to not point to freed memory anymore */
|
||||
Curl_bufref_set(&data->state.url, NULL, 0, NULL);
|
||||
failf(data, "No URL set");
|
||||
return CURLE_URL_MALFORMAT;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user