multi: make max_total_* members size_t#19618
Conversation
|
This one needs a rebase! |
Check size_t conversion on setting these members via CURLMIPT_*. Use members without casting.
3df3256 to
96515fd
Compare
| *puznum = 0; | ||
| return FALSE; | ||
| } | ||
| #if SIZEOF_LONG > SIZEOF_SIZE_T |
There was a problem hiding this comment.
Does such a platform actually exist?
Long is always at least 32 bits. Often 64 bits. Is there a platform where long is 64 bits where size_t is not?
There was a problem hiding this comment.
I do not know. is it forbidden?
There was a problem hiding this comment.
I'm thinking:
1.if it can't happen we don't need to check for it here
2.if it actually can happen, I bet there are other places that would need fixing
3.Maybe we should have a single spot in curl_setup.h or somewhere that just #error on this condition to make us certain it is forbidden in our code?
There was a problem hiding this comment.
As I understand the C language standard, there is no relation defined between long and size_t. So, it seems possible but unlikely.
A general catch in curl_setup.h might be good, especially given that long appears in our API a lot.
There was a problem hiding this comment.
Moved the check info curl_setup.h with an #error.
Check size_t conversion on setting these members via CURLMIPT_*. Use members without casting.