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

7zip archives are sometimes considered malformed #535

Open
evilrix opened this issue May 9, 2015 · 5 comments
Open

7zip archives are sometimes considered malformed #535

evilrix opened this issue May 9, 2015 · 5 comments

Comments

@evilrix
Copy link

evilrix commented May 9, 2015

Create two 7z files. Each contains a folder called "test". Each contains an empty file in the test folder called "y".

One contains an empty file in the test folder called "xx" and the other contains an empty file in the test folder called "xxx".

When extracting the file with "xxx" libarchive fails with the error :"libarchive error: Damaged 7-Zip archive - unable to get next archive item (-1)"/

When extracting the file with "xx" extraction works as expected.

@kientzle
Copy link
Contributor

kientzle commented May 9, 2015

Can you provide the 7z files in question?

Thank you,

Tim

On May 8, 2015, at 6:43 PM, evilrix notifications@github.com wrote:

Create two 7z files. Each contains a folder called "test". Each contains an empty file in the test folder called "y".

One contains an empty file in the test folder called "xx" and the other contains an empty file in the test folder called "xxx".

When extracting the file with "xxx" libarchive fails with the error :"libarchive error: Damaged 7-Zip archive - unable to get next archive item (-1)"/

When extracting the file with "xx" extraction works as expected.


Reply to this email directly or view it on GitHub #535.

@evilrix
Copy link
Author

evilrix commented May 11, 2015

Hello, Tim. Thanks for reviewing this ticket. I've uploaded examples of the 7zip files plus code snippets demonstrating my implementation for the read and seek callbacks. I accept this could be my fault if these are wrong, so any observations you have on these implementations would be welcome. That said, they work fine for zip files; although, I think I am right in saying zip doesn't use the seeker function, right?

https://github.com/evilrix/catfood/tree/libarchive-issues-535

I'm very keen to get to the bottom of this so please do let me know if there is anything else I can do to assist you with this issue (testing/more examples).

Best regards,

-Rix

@TomerHeber
Copy link
Contributor

I cannot share my extraction code. However, I can confirm that I was able to extract the file after the fix for #556:

test_bad.7z
Reading: /tmp/test_bad.7z
Mime type detected: application/x-7z-compressed

Inflated file name - mime type: test/ - text/directory

Inflated file name - mime type: test/xxx - text/directory

Inflated file name - mime type: test/y - text/directory

OK: extracted text!
Total Data In (bytes): 135
Total Text Out (bytes): 0

@evilrix
Copy link
Author

evilrix commented Jul 21, 2015

Thank you TomerHeber for sharing that.

@kientzle
Copy link
Contributor

kientzle commented Jun 3, 2016

If you could re-test with libarchive 3.2, I would greatly appreciate it. That seems to have fixed some 7z issues.

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

No branches or pull requests

3 participants