Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6394C2009F3 for ; Fri, 20 May 2016 18:23:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 62429160A2A; Fri, 20 May 2016 16:23:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D2DE41609B1 for ; Fri, 20 May 2016 18:23:13 +0200 (CEST) Received: (qmail 43569 invoked by uid 500); 20 May 2016 16:23:13 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 43553 invoked by uid 99); 20 May 2016 16:23:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 May 2016 16:23:12 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id DB3882C1F5D for ; Fri, 20 May 2016 16:23:12 +0000 (UTC) Date: Fri, 20 May 2016 16:23:12 +0000 (UTC) From: "Stefan Bodewig (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (COMPRESS-355) Parsing PAX headers fails with NegativeArraySizeException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 20 May 2016 16:23:14 -0000 [ https://issues.apache.org/jira/browse/COMPRESS-355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stefan Bodewig resolved COMPRESS-355. ------------------------------------- Resolution: Fixed Fix Version/s: 1.12 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)