Skip to content
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

Fix for #263: prevent overflow in multipart chunk offset reconstruction #433

Merged
merged 3 commits into from
Jul 12, 2019

Conversation

peterhillman
Copy link
Contributor

Minor change. The original test is probably redundant now, but I'm not completely sure that there isn't an edge case

if(y_coordinate < header.dataWindow().min.y || y_coordinate > header.dataWindow().max.y)
{
// bail to exception catcher: y out of range. Test now to prevent overflow in following arithmetic
throw int();
Copy link
Contributor

Choose a reason for hiding this comment

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

throw int() occurs four times in this file, and nowhere else. I suspect it's legacy. Probably

throw IEX_NAMESPACE::IoExc("y out of range");

and similar should replace all the throw int() in this file. Should we hit all four in this commit?

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'll do that. I think I originally wrote those intending to refactor them out.
I think they can be replaced with break but throwing an exception with a message as you suggest will make it easier to debug

Copy link
Contributor

@meshula meshula left a comment

Choose a reason for hiding this comment

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

looks good, thanks!

@peterhillman peterhillman merged commit 700e499 into AcademySoftwareFoundation:master Jul 12, 2019
@cary-ilm cary-ilm added this to the v2.4.0 milestone Aug 10, 2019
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.

3 participants