You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Stefan Bodewig (JIRA)" <ji...@apache.org> on 2016/05/20 16:23:12 UTC

[jira] [Comment Edited] (COMPRESS-355) Parsing PAX headers fails with NegativeArraySizeException

    [ https://issues.apache.org/jira/browse/COMPRESS-355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293645#comment-15293645 ] 

Stefan Bodewig edited comment on COMPRESS-355 at 5/20/16 4:22 PM:
------------------------------------------------------------------

Thank you.

Applied the suggested change and added a test case (the first 8k of the aws tgz you described) with commit 19a620c.


was (Author: bodewig):
Applied the suggested change and added a test case (the first 8k of the aws tgz you described) with commit 19a620c

> Parsing PAX headers fails with NegativeArraySizeException
> ---------------------------------------------------------
>
>                 Key: COMPRESS-355
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-355
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Archivers
>    Affects Versions: 1.11
>            Reporter: Jeremy Gustie
>             Fix For: 1.12
>
>
> The {{TarArchiveInputStream.parsePaxHeaders}} method fails with a {{NegativeArraySizeException}} when there is an empty line at the end of the headers.
> The inner loop starts reading the length, but it gets a newline (10) and ends up subtracting '0' (48) from it; the result is a negative length that blows up an attempt to allocate the {{rest}} array.
> I would say that a check to see if {{ch}} is less the '0' and break the loop if it is.
> I used {{npm pack aws-sdk@2.2.16}} to generate a tarball with this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)