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

Length check in the LFH constructor #1742

Merged
merged 1 commit into from
Jul 25, 2022

Conversation

Nikipedia
Copy link

A maximum length is given to the constructor to detect corruption and prevent reading over the borders of the LFH.
In case the lengths read from the buffer are larger than the buffer itself, bad_data is thrown.

…d prevent reading over the borders of the LFH
@simonmichal simonmichal marked this pull request as ready for review July 25, 2022 10:26
@simonmichal
Copy link
Contributor

@Nikipedia : thanks for the PR.

AFAIU the intention is that if the optional argument bufferSize is not provided the checks are omitted, which provides backwards compatibility (that's good :-).

I added 2 minor comments about moving throw to next line in if statement, could you please address them?

src/XrdZip/XrdZipLFH.hh Outdated Show resolved Hide resolved
src/XrdZip/XrdZipLFH.hh Outdated Show resolved Hide resolved
@simonmichal simonmichal merged commit ac7b170 into xrootd:master Jul 25, 2022
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.

None yet

3 participants