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


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 248501a387 Fix AJP message length check
248501a387 is described below

commit 248501a387db1d0d97134b1a4dbffad2c20689e8
Author: remm <[email protected]>
AuthorDate: Mon Nov 3 10:03:23 2025 +0100

    Fix AJP message length check
    
    PR#916 by Joshua Rogers.
---
 java/org/apache/coyote/ajp/AjpProcessor.java | 2 +-
 webapps/docs/changelog.xml                   | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java 
b/java/org/apache/coyote/ajp/AjpProcessor.java
index 3164656346..b766a4ee6d 100644
--- a/java/org/apache/coyote/ajp/AjpProcessor.java
+++ b/java/org/apache/coyote/ajp/AjpProcessor.java
@@ -567,7 +567,7 @@ public class AjpProcessor extends AbstractProcessor {
             // Zero length message.
             return true;
         } else {
-            if (messageLength > message.getBuffer().length) {
+            if (messageLength > (buf.length - Constants.H_SIZE)) {
                 // Message too long for the buffer
                 // Need to trigger a 400 response
                 String msg = sm.getString("ajpprocessor.header.tooLong", 
Integer.valueOf(messageLength),
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 48f39f5130..361daf816d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -131,6 +131,10 @@
         Fix potential crash on shutdown when a Connector depends on the Tomcat
         Native library. (markt)
       </fix>
+      <fix>
+        Fix AJP message length check. Pull request <pr>916</pr> by Joshua
+        Rogers. (remm)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">


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

Reply via email to