diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java index 8b798a51be5..78a792b83a8 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java @@ -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; @@ -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;