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

MaxSize of the EOCD constructor and check against file size #1744

Merged
merged 1 commit into from
Jul 25, 2022

Conversation

Nikipedia
Copy link

Check the EOCD length against the actual buffer size to detect corruption in the EOCD and to avoid reading over the end of the file. Default argument is still zero to allow for compatibility.
In the XrdClZipArchive's OpenArchive method, the call to the EOCD constructor catches the bad_data error.
Additionally added a check of the "cdOffset" and "cdSize" attributes of the EOCD object against the archive size.
In case of failure, the OpenArchive operation is stopped and returns an error status.

src/XrdZip/XrdZipEOCD.hh Outdated Show resolved Hide resolved
src/XrdCl/XrdClZipArchive.cc Show resolved Hide resolved
@Nikipedia Nikipedia force-pushed the EOCDRequest branch 2 times, most recently from 28b1dfd to 0fbaab2 Compare July 25, 2022 14:06
@simonmichal simonmichal marked this pull request as ready for review July 25, 2022 14:30
@simonmichal simonmichal merged commit 1ae7411 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