You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2019/12/27 20:19:46 UTC

[commons-codec] branch master updated: Avoid negative length additions to incremental hash.

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git


The following commit(s) were added to refs/heads/master by this push:
     new 48bc987  Avoid negative length additions to incremental hash.
48bc987 is described below

commit 48bc987144a579618a914e853c09616d816dd25d
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Fri Dec 27 20:19:42 2019 +0000

    Avoid negative length additions to incremental hash.
---
 src/main/java/org/apache/commons/codec/digest/MurmurHash3.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/codec/digest/MurmurHash3.java b/src/main/java/org/apache/commons/codec/digest/MurmurHash3.java
index 65f174d..d4a95ea 100644
--- a/src/main/java/org/apache/commons/codec/digest/MurmurHash3.java
+++ b/src/main/java/org/apache/commons/codec/digest/MurmurHash3.java
@@ -1015,7 +1015,7 @@ public final class MurmurHash3 {
          * @param length The length of array
          */
         public final void add(final byte[] data, final int offset, final int length) {
-            if (length == 0) {
+            if (length <= 0) {
                 // Nothing to add
                 return;
             }