mirror of
https://github.com/curl/curl.git
synced 2026-08-26 05:03:33 +03:00
urldata: make magic be the first struct field
By making the `magic` identifier the same size and at the same place within the structs (easy, multi, share), libcurl will be able to more reliably detect and safely error out if an application passes in the wrong handle to APIs. Easier to detect and less likely to cause crashes if done. Such mixups can't be detected at compile-time due to them being typedefed void pointers - unless `CURL_STRICTER` is defined. Closes #6484
This commit is contained in:
parent
13bc1ea9bc
commit
942cf12c2f
6 changed files with 24 additions and 11 deletions
|
|
@ -2169,8 +2169,9 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
|||
data->share = NULL;
|
||||
}
|
||||
|
||||
/* use new share if it set */
|
||||
data->share = set;
|
||||
if(GOOD_SHARE_HANDLE(set))
|
||||
/* use new share if it set */
|
||||
data->share = set;
|
||||
if(data->share) {
|
||||
|
||||
Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue