mirror of
https://github.com/curl/curl.git
synced 2026-08-25 00:03:33 +03:00
multi: forbid curl_easy_pause from within multi socket callback
- there is a risk for a nasty recursive situation - we avoid certain risks that the pause call changes things so that when returning from the callback, the state of some internals is undefined and we need to reload which is easy to miss - we can't think of legitiate use cases for doing this. This is basically just the new favorite point for AI and security researchers to find hypothetical problems Closes #22179
This commit is contained in:
parent
d8f9f0a912
commit
a6af50c484
7 changed files with 33 additions and 21 deletions
|
|
@ -3906,15 +3906,16 @@ static void process_pending_handles(struct Curl_multi *multi)
|
|||
}
|
||||
}
|
||||
|
||||
void Curl_set_in_callback(struct Curl_easy *data, bool value)
|
||||
/* 'value' used to be a boolean but can now also contain more info */
|
||||
void Curl_set_in_callback(struct Curl_easy *data, uint8_t value)
|
||||
{
|
||||
if(data && data->multi)
|
||||
data->multi->in_callback = value;
|
||||
}
|
||||
|
||||
bool Curl_is_in_callback(struct Curl_easy *data)
|
||||
uint8_t Curl_is_in_callback(struct Curl_easy *data)
|
||||
{
|
||||
return data && data->multi && data->multi->in_callback;
|
||||
return (data && data->multi) ? data->multi->in_callback : IN_CALLBACK_NO;
|
||||
}
|
||||
|
||||
unsigned int Curl_multi_max_concurrent_streams(struct Curl_multi *multi)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue