peterreilly 2005/01/10 09:12:30 Modified: . Tag: ANT_16_BRANCH CONTRIBUTORS WHATSNEW src/main/org/apache/tools/tar Tag: ANT_16_BRANCH TarBuffer.java Log: sync Revision Changes Path No revision No revision 1.1.2.29 +1 -0 ant/CONTRIBUTORS Index: CONTRIBUTORS =================================================================== RCS file: /home/cvs/ant/CONTRIBUTORS,v retrieving revision 1.1.2.28 retrieving revision 1.1.2.29 diff -u -r1.1.2.28 -r1.1.2.29 --- CONTRIBUTORS 19 Nov 2004 09:10:00 -0000 1.1.2.28 +++ CONTRIBUTORS 10 Jan 2005 17:12:28 -0000 1.1.2.29 @@ -170,6 +170,7 @@ Rami Ojares Randy Watler Raphael Pierquin +Ray Waldin Richard Evans Rick Beton Robert Anderson 1.503.2.155 +3 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.503.2.154 retrieving revision 1.503.2.155 diff -u -r1.503.2.154 -r1.503.2.155 --- WHATSNEW 27 Dec 2004 11:33:20 -0000 1.503.2.154 +++ WHATSNEW 10 Jan 2005 17:12:28 -0000 1.503.2.155 @@ -111,6 +111,9 @@ * <setproxy> 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 =================================== No revision No revision 1.8.2.5 +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.8.2.4 retrieving revision 1.8.2.5 diff -u -r1.8.2.4 -r1.8.2.5 --- TarBuffer.java 9 Mar 2004 17:02:00 -0000 1.8.2.4 +++ TarBuffer.java 10 Jan 2005 17:12:29 -0000 1.8.2.5 @@ -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 '[EMAIL PROTECTED]' 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]