This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 94a295ac6c Avoid changing channel state on reset(null,null)
94a295ac6c is described below

commit 94a295ac6cce3ad5f20de1932486010b1ac9bc4a
Author: remm <[email protected]>
AuthorDate: Mon Jan 26 10:38:27 2026 +0100

    Avoid changing channel state on reset(null,null)
    
    BZ69938
---
 java/org/apache/tomcat/util/net/SecureNioChannel.java | 12 +++++++-----
 webapps/docs/changelog.xml                            |  4 ++++
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/SecureNioChannel.java 
b/java/org/apache/tomcat/util/net/SecureNioChannel.java
index af80209cbf..95b9754745 100644
--- a/java/org/apache/tomcat/util/net/SecureNioChannel.java
+++ b/java/org/apache/tomcat/util/net/SecureNioChannel.java
@@ -94,11 +94,13 @@ public class SecureNioChannel extends NioChannel {
     public void reset(SocketChannel channel, NioSocketWrapper socketWrapper) 
throws IOException {
         super.reset(channel, socketWrapper);
         sslEngine = null;
-        sniComplete = false;
-        handshakeComplete = false;
-        closed = false;
-        closing = false;
-        netInBuffer.clear();
+        if (channel != null) {
+            sniComplete = false;
+            handshakeComplete = false;
+            closed = false;
+            closing = false;
+            netInBuffer.clear();
+        }
     }
 
     @Override
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e3fdf17b79..31d3b736b0 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -228,6 +228,10 @@
         shutdown that triggered a significant memory leak. Patch provided by
         Wes. (markt)
       </fix>
+      <fix>
+        <bug>69938</bug>: Avoid changing the closed state of TLS channel when
+        resetting it after close. (remm)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to