Index: modules/security/src/main/java/common/java/security/MessageDigest.java =================================================================== --- modules/security/src/main/java/common/java/security/MessageDigest.java (revision 420501) +++ modules/security/src/main/java/common/java/security/MessageDigest.java (working copy) @@ -164,8 +164,8 @@ * */ public void update(byte[] input, int offset, int len) { - if (input == null || offset < 0 || len < 0 || - offset + len > input.length) { + if (input == null || offset < 0 || len < 0 || offset > input.length + || len > input.length || offset + len > input.length) { throw new IllegalArgumentException( "Incorrect offset/len parameters"); } @@ -200,8 +200,8 @@ * */ public int digest(byte[] buf, int offset, int len) throws DigestException { - if (buf == null || offset < 0 || len < 0 || - offset + len > buf.length) { + if (buf == null || offset < 0 || len < 0 || offset > buf.length + || len > buf.length || offset + len > buf.length) { throw new IllegalArgumentException( "Incorrect offset/len parameters"); }