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

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

commit d5b9e9969413d59cde6cafb7124e0f9235c59e77
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 b7273bf295..44ddfa5442 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 b5ac311f8a..db49f21a4e 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -122,6 +122,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>
 </section>


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

Reply via email to