commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [1/3] commons-compress git commit: COMPRESS-417 ignore devmajor/minor unless entry is a CHR or BLK device
Date Wed, 19 Jul 2017 11:18:52 GMT
Repository: commons-compress
Updated Branches:
  refs/heads/master 6081e2630 -> 52cb7925a


COMPRESS-417 ignore devmajor/minor unless entry is a CHR or BLK device


Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/002d7bf5
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/002d7bf5
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/002d7bf5

Branch: refs/heads/master
Commit: 002d7bf508ee59f23a04a9f21d02e9673dd38a71
Parents: 6081e26
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Wed Jul 19 13:15:09 2017 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Wed Jul 19 13:15:09 2017 +0200

----------------------------------------------------------------------
 .../apache/commons/compress/archivers/tar/TarArchiveEntry.java   | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/002d7bf5/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
index 8595252..a13cf4b 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
@@ -1271,10 +1271,14 @@ public class TarArchiveEntry implements ArchiveEntry, TarConstants
{
         groupName = oldStyle ? TarUtils.parseName(header, offset, GNAMELEN)
             : TarUtils.parseName(header, offset, GNAMELEN, encoding);
         offset += GNAMELEN;
+        if (linkFlag == LF_CHR || linkFlag == LF_BLK) {
         devMajor = (int) TarUtils.parseOctalOrBinary(header, offset, DEVLEN);
         offset += DEVLEN;
         devMinor = (int) TarUtils.parseOctalOrBinary(header, offset, DEVLEN);
         offset += DEVLEN;
+        } else {
+            offset += 2 * DEVLEN;
+        }
 
         final int type = evaluateType(header);
         switch (type) {


Mime
View raw message