Skip to content

Commit

Permalink
[UNDERTOW-2252] Potential fix for the SslConduit.dataToUnwrap buffer …
Browse files Browse the repository at this point in the history
…leak

Signed-off-by: Flavia Rainone <[email protected]>
  • Loading branch information
fl4via committed Mar 26, 2023
1 parent 1302c8c commit f0a0f24
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions core/src/main/java/io/undertow/protocols/ssl/SslConduit.java
Original file line number Diff line number Diff line change
Expand Up @@ -1276,14 +1276,16 @@ public void readReady() {
}
if(anyAreSet(state, FLAG_READS_RESUMED) && (unwrappedData != null || anyAreSet(state, FLAG_DATA_TO_UNWRAP))) {
if(anyAreSet(state, FLAG_READ_CLOSED)) {
if(unwrappedData != null) {
unwrappedData.close();
}
if(dataToUnwrap != null) {
dataToUnwrap.close();
synchronized (SslConduit.this) {
if (unwrappedData != null) {
unwrappedData.close();
}
if (dataToUnwrap != null) {
dataToUnwrap.close();
}
unwrappedData = null;
dataToUnwrap = null;
}
unwrappedData = null;
dataToUnwrap = null;
} else {
//there is data in the buffers so we do a wakeup
//as we may not get an actual read notification
Expand Down

0 comments on commit f0a0f24

Please sign in to comment.