Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-355

Parsing PAX headers fails with NegativeArraySizeException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.11
    • Fix Version/s: 1.12
    • Component/s: Archivers
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jgustie Jeremy Gustie
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: