added check for null input on doFinal().
@@ -357,7 +357,10 @@ protected int engineUpdate(
throw new IllegalStateException("not supported in a wrapping mode");
}
+ if (input != null)
+ {
wrapStream.write(input, inputOffset, inputLen);
+ }
try
{
