Skip to content

Commit 9b87e53

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

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
@@ -851,7 +851,7 @@ public synchronized SSLEngineResult wrap(ByteBuffer[] in, int ofst, int len,
851851
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
852852
() -> "setUseClientMode: " +
853853
this.engineHelper.getUseClientMode());
854-
for (i = 0; i < len; i++) {
854+
for (i = ofst; i < ofst + len; i++) {
855855
final int idx = i;
856856
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
857857
() -> "ByteBuffer in["+idx+"].remaining(): " +
@@ -1370,7 +1370,7 @@ public synchronized SSLEngineResult unwrap(ByteBuffer in, ByteBuffer[] out,
13701370
() -> "in.position(): " + in.position());
13711371
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
13721372
() -> "in.limit(): " + in.limit());
1373-
for (i = 0; i < length; i++) {
1373+
for (i = ofst; i < ofst + length; i++) {
13741374
final int idx = i;
13751375
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
13761376
() -> "out["+idx+"].remaining(): " +

0 commit comments

Comments
 (0)