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

Use correct offset when previous entry is a directory. #509

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

krite
Copy link

@krite krite commented Apr 4, 2024

Current implementation cannot read tar-files with folders.
This can easily be tested either by using commons-compress or any other valid tar-tool.
Create a simple folder-structure containing two folders, with a single file in each, create a uncompressed tar-file.
Reading back the file will cause a "Corrupted TAR archive" from TarArchiveEntry:1464, since the incorrect data has been read into the current buffer, it's offset by the previous 'folder-size' too much. The header can thus not be correctly parsed and the code crashes.

@garydgregory
Copy link
Member

Hello @krite
You'll need a unit test and possibly a test fixture to prove this fixes anything and to avoid future regressions.
TY!

@garydgregory
Copy link
Member

@krite
ping.

@garydgregory
Copy link
Member

garydgregory commented Jul 30, 2024

Hello @krite
Do you have a sample file that would cause a new unit test to fail?
Or, can you write a new test using an existing test resource that fails without the change to main?

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.

2 participants