Skip to content

FIX: buffer overflow in integer when setting to 1e10 and enhance documentation #267

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

Merged
merged 4 commits into from
Apr 16, 2025

Conversation

ferdymercury
Copy link
Contributor

@ferdymercury ferdymercury commented Apr 1, 2025

@cpinter It caused the value to be randomly cut to int (MAX_INT<1e10) (undefined behavior, platform dependent).

Convert underlying data type to long to avoid this truncation. Cast also multiplication to long, since int ^ 2 can easily surpass the limits of int.

@ferdymercury ferdymercury changed the title FIX: buffer overflow in integer when setting to 1e10 FIX: buffer overflow in integer when setting to 1e10 and enhance documentation Apr 1, 2025
@cpinter
Copy link
Member

cpinter commented Apr 15, 2025

Sorry for the long wait. Looks good, but please stick to the Slicer style commit prefixes. For documentation only changes use DOC, for fixes BUG, for typos STYLE (see here). Thanks a lot!

It caused the value to be randomly cut to int (undefined behavior, platform dependent).

Convert underlying data type to long to avoid this truncation. Cast also multiplication to long, since int ^ 2 can easily surpass the limits of int.

Also fix UTF8 accented char in docu
@ferdymercury
Copy link
Contributor Author

Thanks Csaba for the review! I reworded as suggested.

@cpinter cpinter merged commit 62a6a99 into SlicerRt:master Apr 16, 2025
@ferdymercury ferdymercury deleted the triangles branch April 16, 2025 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants