Skip to content

Commit

Permalink
Fix the P11Cipher AES/ECB/PKCS5Padding array index out of range issue
Browse files Browse the repository at this point in the history
Signed-off-by: Tao Liu <tao.liu@ibm.com>
  • Loading branch information
taoliult committed Jan 24, 2023
1 parent b399e86 commit ca0d683
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

/*
* ===========================================================================
* (c) Copyright IBM Corp. 2022, 2023 All Rights Reserved
* ===========================================================================
*/

package sun.security.pkcs11;

import java.nio.ByteBuffer;
Expand Down Expand Up @@ -604,7 +611,7 @@ private int implUpdate(byte[] in, int inOfs, int inLen,
if (padBufferLen != 0) {
if (padBufferLen != padBuffer.length) {
int bufCapacity = padBuffer.length - padBufferLen;
if (inLen > bufCapacity) {
if (inLen >= bufCapacity) {
bufferInputBytes(in, inOfs, bufCapacity);
inOfs += bufCapacity;
inLen -= bufCapacity;
Expand Down

0 comments on commit ca0d683

Please sign in to comment.