Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 34035 invoked from network); 10 Jan 2005 17:12:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Jan 2005 17:12:18 -0000 Received: (qmail 33830 invoked by uid 500); 10 Jan 2005 17:12:14 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 33764 invoked by uid 500); 10 Jan 2005 17:12:14 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 33733 invoked by uid 500); 10 Jan 2005 17:12:13 -0000 Received: (qmail 33714 invoked by uid 99); 10 Jan 2005 17:12:13 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Mon, 10 Jan 2005 09:12:12 -0800 Received: (qmail 33942 invoked by uid 1539); 10 Jan 2005 17:12:10 -0000 Date: 10 Jan 2005 17:12:10 -0000 Message-ID: <20050110171210.33941.qmail@minotaur.apache.org> From: peterreilly@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant/src/main/org/apache/tools/tar TarBuffer.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N peterreilly 2005/01/10 09:12:10 Modified: . CONTRIBUTORS WHATSNEW src/main/org/apache/tools/tar TarBuffer.java Log: fix for infinite loop on incorrect tar files PR: 29877 Obtained from: Ray Waldin Revision Changes Path 1.41 +1 -0 ant/CONTRIBUTORS Index: CONTRIBUTORS =================================================================== RCS file: /home/cvs/ant/CONTRIBUTORS,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- CONTRIBUTORS 26 Nov 2004 09:52:05 -0000 1.40 +++ CONTRIBUTORS 10 Jan 2005 17:12:10 -0000 1.41 @@ -172,6 +172,7 @@ Rami Ojares Randy Watler Raphael Pierquin +Ray Waldin Richard Evans Rick Beton Robert Anderson 1.707 +3 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.706 retrieving revision 1.707 diff -u -r1.706 -r1.707 --- WHATSNEW 7 Jan 2005 21:58:23 -0000 1.706 +++ WHATSNEW 10 Jan 2005 17:12:10 -0000 1.707 @@ -227,6 +227,9 @@ * failed to set user/password on some JDKs. Bugzilla report 32667 +* untar would go into infinite loop for some invalid tar files. + Bugzill report 29877 + Changes from Ant 1.6.1 to Ant 1.6.2 =================================== 1.13 +10 -1 ant/src/main/org/apache/tools/tar/TarBuffer.java Index: TarBuffer.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/tar/TarBuffer.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- TarBuffer.java 9 Mar 2004 16:48:55 -0000 1.12 +++ TarBuffer.java 10 Jan 2005 17:12:10 -0000 1.13 @@ -1,5 +1,5 @@ /* - * Copyright 2000,2002,2004 The Apache Software Foundation + * Copyright 2000,2002,2004-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; +import java.util.Arrays; /** * The TarBuffer class implements the tar archive concept @@ -231,6 +232,14 @@ // Thanks to 'Yohann.Roussel@alcatel.fr' for this fix. // if (numBytes == -1) { + // However, just leaving the unread portion of the buffer dirty does + // cause problems in some cases. This problem is described in + // http://issues.apache.org/bugzilla/show_bug.cgi?id=29877 + // + // The solution is to fill the unused portion of the buffer with zeros. + + Arrays.fill(blockBuffer, offset, offset + bytesNeeded, (byte) 0); + break; } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org