Skip to content

Commit bbd3a4a

Browse files
authored
Fix OpenSslClientSessionCache remove (#14366)
Motivation: Loop was adding `nativeSslSession` to the `toBeRemoved` list, instead of the loop variable `sslSession`. Modification: Add the loop variable instead, because the `nativeSslSession` can very likely be null at that point, and is specifically also not the session we want to remove. Result: Fewer bugs in SSL session caching
1 parent ddbac87 commit bbd3a4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

handler/src/main/java/io/netty/handler/ssl/OpenSslClientSessionCache.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ boolean setSession(long ssl, OpenSslSession session, String host, int port) {
9999
if (toBeRemoved == null) {
100100
toBeRemoved = new ArrayList<NativeSslSession>(2);
101101
}
102-
toBeRemoved.add(nativeSslSession);
102+
toBeRemoved.add(sslSession);
103103
}
104104
}
105105

0 commit comments

Comments
 (0)