Skip to content

Commit

Permalink
JSSE: check this.toSend for null before getting length in SSLEngine.u…
Browse files Browse the repository at this point in the history
…nwrap() when we have data buffered
  • Loading branch information
cconlon committed May 17, 2024
1 parent ddb9d2b commit 8d805ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/provider/jsse/WolfSSLEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ public synchronized SSLEngineResult unwrap(ByteBuffer in, ByteBuffer[] out,
hs = SSLEngineResult.HandshakeStatus.NEED_WRAP;
}
else if (hs == SSLEngineResult.HandshakeStatus.NEED_WRAP &&
this.toSend.length > 0) {
(this.toSend != null) && (this.toSend.length > 0)) {
/* Already have data buffered to send and in NEED_WRAP state,
* just return so wrap() can be called */
hs = SSLEngineResult.HandshakeStatus.NEED_WRAP;
Expand Down

0 comments on commit 8d805ff

Please sign in to comment.