Skip to content

Restrict range of buffer_length on all platforms to INT_MAX #9126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Jul 25, 2022

This has only been done for Windows systems so far, and there was a
TODO comment about looping for larger values; that appears to be
overkill, though, since 2 million bytes should be sufficient for all
use cases, and if there is really the need for more, users can still
loop manually. Anyhow, checking the range upfront on all platforms
is clearer then silently casting to int.


I've noticed that while I was about to get rid of the Windows specifc code in that function, and I think it's a sensible preparation for that.

This has only been done for Windows systems so far, and there was a
TODO comment about looping for larger values; that appears to be
overkill, though, since 2 million bytes should be sufficient for all
use cases, and if there is really the need for more, users can still
loop manually.  Anyhow, checking the range upfront on all platforms
is clearer then silently casting to `int`.
@cmb69
Copy link
Member Author

cmb69 commented Jul 25, 2022

The Travis CI failure is unrelated.

@cmb69 cmb69 requested a review from bukka July 25, 2022 14:28
@cmb69 cmb69 requested a review from bukka July 25, 2022 18:04
@cmb69 cmb69 closed this in e52946e Jul 26, 2022
@cmb69 cmb69 deleted the cmb/openssl_random_pseudo_bytes-range branch July 26, 2022 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants