On Fri, 21 May 2021 03:07:15 GMT, Anthony Scarpino <ascarp...@openjdk.org> 
wrote:

>> yeah these checks are a bit all over the place.. I'll rework them
>
> So I think I only need to add a check to the engineDoFinal() that did not 
> have a check before.

for engineUpdate(...) impl, the ArrayUtil.nullAndBoundsCheck() calls are 
deferred to GCMEngine.doUpdate(...). In the case of engineUpdate(byte[] input, 
int inputOffset, int inputLen, byte[] output, int outputOffset) method, the 
inputLen is already used to calculate the needed output size before the check 
takes place. For consistency and correctness, shouldn't the check be done 
before the values are used, as in engineDoFinal() case?

-------------

PR: https://git.openjdk.java.net/jdk/pull/4072

Reply via email to