This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 68805e41cb Fix a potential integer overflow...
68805e41cb is described below
commit 68805e41cbb7ebc823fef016e191e263762e3423
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Apr 30 15:46:03 2026 +0100
Fix a potential integer overflow...
...when allocating capacity from a connection level window update to
individual HTTP/2 streams.
Based on #996 by Mike Tingey Jr.
---
java/org/apache/coyote/http2/Http2UpgradeHandler.java | 3 ++-
webapps/docs/changelog.xml | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 656aa63ffd..b416307c0e 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -1186,7 +1186,8 @@ class Http2UpgradeHandler extends AbstractStream
implements InternalHttpUpgradeH
break;
}
- int share = (int)
(s.getConnectionAllocationRequested() * remaining /
+ // Cast to long during the intermediate calculation to
avoid integer overflow in multiplication
+ int share = (int) ((long)
s.getConnectionAllocationRequested() * remaining /
requestedAllocationForIncrementalStreams);
if (share == 0) {
share = 1;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 808791c958..64f085c0ab 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -209,6 +209,11 @@
Correct the validation of pseudo headers and CONNECT requests to align
Tomcat's behaviour with RFC 9113, section 8.5. (markt)
</fix>
+ <fix>
+ Fix a potential integer overflow when allocating capacity from a
+ connection level window update to individual HTTP/2 streams. Based on
+ <pr>996</pr> by Mike Tingey Jr. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Other">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]