commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1588618 - in /commons/proper/compress/trunk/src: changes/changes.xml main/java/org/apache/commons/compress/archivers/tar/TarUtils.java test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
Date Sat, 19 Apr 2014 06:00:20 GMT
Author: bodewig
Date: Sat Apr 19 06:00:19 2014
New Revision: 1588618

URL: http://svn.apache.org/r1588618
Log:
COMPRESS-278 all empty numeric fields should be ignored in tars

Modified:
    commons/proper/compress/trunk/src/changes/changes.xml
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java

Modified: commons/proper/compress/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/changes/changes.xml?rev=1588618&r1=1588617&r2=1588618&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/changes/changes.xml (original)
+++ commons/proper/compress/trunk/src/changes/changes.xml Sat Apr 19 06:00:19 2014
@@ -74,6 +74,10 @@ The <action> type attribute can be add,u
       <action type="fix" date="2014-04-18" issue="COMPRESS-273">
         Added a few null checks to improve robustness.
       </action>
+      <action type="fix" date="2014-04-19" issue="COMPRESS-278">
+        TarArchiveInputStream failed to read archives with empty
+        gid/uid fields.
+      </action>
     </release>
     <release version="1.8" date="2014-03-12"
              description="Release 1.8">

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java?rev=1588618&r1=1588617&r2=1588618&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
Sat Apr 19 06:00:19 2014
@@ -130,10 +130,6 @@ public class TarUtils {
             end--;
             trailer = buffer[end - 1];
         }
-        if (start == end) {
-            throw new IllegalArgumentException(
-                    exceptionMessage(buffer, offset, length, start, trailer));
-        }
 
         for ( ;start < end; start++) {
             final byte currentByte = buffer[start];

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java?rev=1588618&r1=1588617&r2=1588618&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
Sat Apr 19 06:00:19 2014
@@ -64,6 +64,9 @@ public class TarUtilsTest extends TestCa
         buffer=new byte[]{0,' '};
         value = TarUtils.parseOctal(buffer,0, buffer.length);
         assertEquals(0, value);
+        buffer=new byte[]{' ',0};
+        value = TarUtils.parseOctal(buffer,0, buffer.length);
+        assertEquals(0, value);
     }
 
     public void testParseOctalInvalid() throws Exception{
@@ -80,12 +83,6 @@ public class TarUtilsTest extends TestCa
             fail("Expected IllegalArgumentException - should be at least 2 bytes long");
         } catch (IllegalArgumentException expected) {
         }
-        buffer=new byte[]{' ',0,0,0}; // not all NULs
-        try {
-            TarUtils.parseOctal(buffer,0, buffer.length);
-            fail("Expected IllegalArgumentException - not all NULs");
-        } catch (IllegalArgumentException expected) {
-        }
         buffer = "abcdef ".getBytes(CharsetNames.UTF_8); // Invalid input
         try {
             TarUtils.parseOctal(buffer,0, buffer.length);



Mime
View raw message