You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2013/12/06 06:22:12 UTC

svn commit: r1548380 - in /commons/proper/compress/trunk/src: changes/changes.xml main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java

Author: bodewig
Date: Fri Dec  6 05:22:12 2013
New Revision: 1548380

URL: http://svn.apache.org/r1548380
Log:
COMPRESS-245 TarArchiveInputStream might fail to read a stream if a single call to read() returns less than a full record

Modified:
    commons/proper/compress/trunk/src/changes/changes.xml
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.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=1548380&r1=1548379&r2=1548380&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/changes/changes.xml (original)
+++ commons/proper/compress/trunk/src/changes/changes.xml Fri Dec  6 05:22:12 2013
@@ -52,6 +52,9 @@ The <action> type attribute can be add,u
               due-to="Nico Kruber">
         7z reading of big 64bit values could be wrong.
       </action> 
+      <action issue="COMPRESS-245" type="fix" date="2013-12-06">
+        TarArchiveInputStream could fail to read an archive completely.
+      </action> 
     </release>
     <release version="1.6" date="2013-10-26"
              description="Release 1.6">

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java?rev=1548380&r1=1548379&r2=1548380&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java (original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java Fri Dec  6 05:22:12 2013
@@ -385,7 +385,7 @@ public class TarArchiveInputStream exten
 
         byte[] record = new byte[recordSize];
 
-        int readNow = is.read(record);
+        int readNow = IOUtils.readFully(is, record);
         count(readNow);
         if (readNow != recordSize) {
             return null;