This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 75bcb075ec Reset the HTTP/2 request header read buffer after a stream
reset
75bcb075ec is described below
commit 75bcb075ec90a50f1ee298ce271fdf46b067c301
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Mar 23 16:08:33 2026 +0000
Reset the HTTP/2 request header read buffer after a stream reset
---
java/org/apache/coyote/http2/Http2Parser.java | 6 ++++++
webapps/docs/changelog.xml | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/java/org/apache/coyote/http2/Http2Parser.java
b/java/org/apache/coyote/http2/Http2Parser.java
index c4844f3b32..8effb9a79a 100644
--- a/java/org/apache/coyote/http2/Http2Parser.java
+++ b/java/org/apache/coyote/http2/Http2Parser.java
@@ -322,6 +322,12 @@ class Http2Parser {
long errorCode = ByteUtil.getFourBytes(payload, 0);
output.reset(streamId, errorCode);
headersCurrentStream = -1;
+ if (headerReadBuffer.capacity() >
Constants.DEFAULT_HEADER_READ_BUFFER_SIZE) {
+ // Reset size for new request if the buffer was previously expanded
+ headerReadBuffer =
ByteBuffer.allocate(Constants.DEFAULT_HEADER_READ_BUFFER_SIZE);
+ } else {
+ headerReadBuffer.clear();
+ }
headersEndStream = false;
}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index df5abdbc38..d8bb50e973 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -122,6 +122,10 @@
connection is closed. Pull request <pr>966</pr> provided by Phil Clay.
(markt)
</fix>
+ <fix>
+ Ensure the HTTP/2 request header read buffer is reset (including
+ restoration to default size) after a stream reset. (markt)
+ </fix>
</changelog>
</subsection>
</section>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]