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 Sep 14, 2022
1 parent 6b49cb4 commit 7ed1d8a
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, 2022 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 7ed1d8a

Please sign in to comment.