Skip to content

Conversation

@icing
Copy link
Contributor

@icing icing commented Nov 20, 2025

Check size_t conversion on setting these members via CURLMIPT_*. Use members without casting.

@icing icing added the tidy-up label Nov 20, 2025
@bagder
Copy link
Member

bagder commented Nov 20, 2025

This one needs a rebase!

Check size_t conversion on setting these members via CURLMIPT_*.
Use members without casting.
@icing icing force-pushed the multi-max-total-size_t branch from 3df3256 to 96515fd Compare November 21, 2025 08:48
@icing icing requested a review from bagder November 21, 2025 09:31
*puznum = 0;
return FALSE;
}
#if SIZEOF_LONG > SIZEOF_SIZE_T
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know. is it forbidden?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the check info curl_setup.h with an #error.

@icing icing requested a review from bagder November 21, 2025 13:12
@bagder bagder closed this in e2be568 Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants