commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [24/28] commons-compress git commit: COMPRESS-380 make second part of assumption explicit
Date Tue, 09 Jan 2018 17:41:17 GMT
COMPRESS-380 make second part of assumption explicit


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

Branch: refs/heads/master
Commit: 19ad28711cd7f0b5e2d8a5fab73b978fdb057882
Parents: 3600a5f
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Mon Jan 8 09:15:24 2018 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Mon Jan 8 09:15:24 2018 +0100

----------------------------------------------------------------------
 .../commons/compress/compressors/deflate64/HuffmanDecoder.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/19ad2871/src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoder.java
b/src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoder.java
index 8b006c3..f1f1042 100644
--- a/src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoder.java
+++ b/src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoder.java
@@ -197,7 +197,7 @@ class HuffmanDecoder implements Closeable {
 
         @Override
         int read(byte[] b, int off, int len) throws IOException {
-            // as len is an int the min must fit into an int as well
+            // as len is an int and (blockLength - read) is >= 0 the min must fit into
an int as well
             int max = (int) Math.min(blockLength - read, len);
             for (int i = 0; i < max; i++) {
                 byte next = (byte) (readBits(Byte.SIZE) & 0xFF);


Mime
View raw message