Skip to content

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

Closed

Description

@anderslanglands

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

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

Activity

  1. peterhillman commented on May 31, 2021

    @peterhillman
    Collaborator

    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.

  2. self-assigned this
    on May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions