Repository: commons-compress
Updated Branches:
  refs/heads/master 8c3201bbd -> 4be9979b4


COMPRESS-411 ensure we really set the most sig byte when length is 8


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

Branch: refs/heads/master
Commit: 6b2bd2df127be522a18d044980e84a8b638f25b7
Parents: 8c3201b
Author: Stefan Bodewig <bode...@apache.org>
Authored: Sat Jun 17 21:45:04 2017 +0200
Committer: Stefan Bodewig <bode...@apache.org>
Committed: Sat Jun 17 21:45:04 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/commons/compress/archivers/tar/TarUtils.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/6b2bd2df/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java 
b/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
index f95bbf3..c0dac4c 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
@@ -503,8 +503,8 @@ public class TarUtils {
         }
         if (negative) {
             val ^= max - 1;
-            val |= 0xff << bits;
             val++;
+            val |= 0xffl << bits;
         }
         for (int i = offset + length - 1; i >= offset; i--) {
             buf[i] = (byte) val;

Reply via email to