Skip to content

Commit 9c99f7d

Browse files
committed
Fix wrap/unwrap debug-log loop bounds
1 parent e72d2cf commit 9c99f7d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/java/com/wolfssl/provider/jsse/WolfSSLEngine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ public synchronized SSLEngineResult wrap(ByteBuffer[] in, int ofst, int len,
850850
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
851851
() -> "setUseClientMode: " +
852852
this.engineHelper.getUseClientMode());
853-
for (i = 0; i < len; i++) {
853+
for (i = ofst; i < ofst + len; i++) {
854854
final int idx = i;
855855
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
856856
() -> "ByteBuffer in["+idx+"].remaining(): " +
@@ -1434,7 +1434,7 @@ public synchronized SSLEngineResult unwrap(ByteBuffer in, ByteBuffer[] out,
14341434
() -> "in.position(): " + in.position());
14351435
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
14361436
() -> "in.limit(): " + in.limit());
1437-
for (i = 0; i < length; i++) {
1437+
for (i = ofst; i < ofst + length; i++) {
14381438
final int idx = i;
14391439
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
14401440
() -> "out["+idx+"].remaining(): " +

0 commit comments

Comments
 (0)