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

Fix symbolic links not properly encoded in ZIP archives #73

Closed
wants to merge 1 commit into from
Closed

Fix symbolic links not properly encoded in ZIP archives #73

wants to merge 1 commit into from

Conversation

plamentotev
Copy link
Member

To encode the symbolic links AbstractZipArchiver uses
ZipEncoding but it does not use it properly.
It uses the whole backing array of the returned ByteBuffer
while it it should use it only up to the buffer limit.
This may lead to additional characters at the end of the
symbolic link.

This does not manifest as a bug because Common Compress up to 1.14
returns a ByteBuffer that wraps a byte array containing the
encoded payload. But Common Compress 1.15 returns new
implementation and we need to fix it before upgrading.
Actually that is how it was found.

To encode the symbolic links `AbstractZipArchiver` uses
`ZipEncoding` but it does not use it properly.
It uses the whole backing array of the returned ByteBuffer
while it it should use it only up to the buffer limit.
This may lead to additional characters at the end of the
symbolic link.

This does not manifest as a bug because Common Compress up to 1.14
returns a ByteBuffer that wraps a byte array containing the
encoded payload. But Common Compress 1.15 returns new
implementation and we need to fix it before upgrading.
Actually that is how it was found.
@michael-o michael-o self-assigned this Oct 21, 2017
@michael-o michael-o added the bug label Oct 21, 2017
@michael-o michael-o added this to the 3.6 milestone Oct 21, 2017
@michael-o michael-o closed this in cbbc266 Oct 21, 2017
@plamentotev plamentotev deleted the fix-symlinks-encoding branch February 16, 2018 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants