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

rmaucher 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 54569b7767 Avoid NPE if no headers frame is processed
54569b7767 is described below

commit 54569b7767bbcf859ae1886d9cac7d77f492b657
Author: remm <[email protected]>
AuthorDate: Tue May 19 15:05:04 2026 +0200

    Avoid NPE if no headers frame is processed
    
    BZ70050
    It is possible to make it final and remove the lazy init of the HPACK
    decoder, but it helps if the processing is limited to a rst frame.
---
 java/org/apache/coyote/http2/Http2Parser.java | 5 ++++-
 webapps/docs/changelog.xml                    | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http2/Http2Parser.java 
b/java/org/apache/coyote/http2/Http2Parser.java
index c75f3139e4..ac54946a83 100644
--- a/java/org/apache/coyote/http2/Http2Parser.java
+++ b/java/org/apache/coyote/http2/Http2Parser.java
@@ -679,7 +679,10 @@ class Http2Parser {
          * Clear the reference to the stream in the HPack decoder now that the 
headers have been processed so that the
          * HPack decoder does not retain a reference to this stream. This aids 
GC.
          */
-        hpackDecoder.clearHeaderEmitter();
+        HpackDecoder hpackDecoder = this.hpackDecoder;
+        if (hpackDecoder != null) {
+            hpackDecoder.clearHeaderEmitter();
+        }
     }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index d233815c0d..fd5b901ec6 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -284,6 +284,10 @@
       <fix>
         Improve enforcement of header trailer allow list for HTTP/2. (remm)
       </fix>
+      <fix>
+        <bug>70050</bug>: Avoid NPE when no header frame is processed in 
HTTP/2,
+        following refactor clean-up of header buffer. (remm)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">


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

Reply via email to