Index: modules/security/src/main/java/common/java/security/MessageDigest.java =================================================================== --- modules/security/src/main/java/common/java/security/MessageDigest.java (revision 429608) +++ modules/security/src/main/java/common/java/security/MessageDigest.java (working copy) @@ -164,11 +164,15 @@ * */ public void update(byte[] input, int offset, int len) { - if (input == null || offset < 0 || len < 0 || - (long)offset + (long)len > input.length) { - throw new IllegalArgumentException( - "Incorrect offset/len parameters"); + if (input == null) { + throw new IllegalArgumentException("No input buffer given"); } + if (offset < 0 || len < 0) { + throw new IndexOutOfBoundsException("Incorrect offset/len parameters"); + } + if ((long)offset + (long)len > input.length) { + throw new IllegalArgumentException("Input buffer too short"); + } engineUpdate(input, offset, len); }