Skip to content

catch malformed Content-Length in HttpIo::getFileLength#9321

Open
netliomax25-code wants to merge 1 commit into
Exiv2:mainfrom
netliomax25-code:httpio-content-length-parse
Open

catch malformed Content-Length in HttpIo::getFileLength#9321
netliomax25-code wants to merge 1 commit into
Exiv2:mainfrom
netliomax25-code:httpio-content-length-parse

Conversation

@netliomax25-code

Copy link
Copy Markdown

The remote server controls the Content-Length header, but getFileLength feeds it straight into std::stoll, so a non-numeric or oversized value throws std::invalid_argument/out_of_range out of RemoteIo::open and aborts the process. Catch the parse failure and return -1, the value already documented for an unknown size, which falls back to fetching the whole file.

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.

1 participant