github - added guard against the "impossible"
@@ -1166,6 +1166,11 @@ protected int engineUpdate(
return tmp;
}
+ if (len > tmp.length)
+ {
+ throw new IllegalBlockSizeException("internal buffer overflow");
+ }
+
byte[] out = new byte[len];
System.arraycopy(tmp, 0, out, 0, len);
