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

MultiPartInputFile::header doesn't check for out-of-bounds access #1031

Closed
anderslanglands opened this issue May 31, 2021 · 1 comment · Fixed by #1038
Closed

MultiPartInputFile::header doesn't check for out-of-bounds access #1031

anderslanglands opened this issue May 31, 2021 · 1 comment · Fixed by #1038
Assignees

Comments

@anderslanglands
Copy link

Should it throw Iex::ArgExc? Or at least use at()?

const Header & MultiPartInputFile::header(int n) const { return _data->_headers[n]; }
@peterhillman
Copy link
Contributor

That seems sensible. All methods in MultiPartInputFile and MultiPartOutputFile that take a part number should do bounds checking. Throwing ArgExc would be better than just using at(), so a more informative error message can be thrown and negative values for n can be handled.

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 a pull request may close this issue.

2 participants