JSSE: check this.toSend for null before getting length in SSLEngine.unwrap() when we have data buffered

pull/193/head
Chris Conlon 2024-05-17 15:07:15 -06:00
parent ddb9d2b0ea
commit 8d805ff796
1 changed files with 1 additions and 1 deletions

View File

@ -965,7 +965,7 @@ public class WolfSSLEngine extends SSLEngine {
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;