You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/04/28 16:29:24 UTC

[tomcat] 02/02: Fix off by one issue in error message generation

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

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 2ce4ea2f8e9111269e990fff640b48847b9e6d87
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Apr 28 17:22:24 2021 +0100

    Fix off by one issue in error message generation
---
 java/org/apache/coyote/http11/Http11InputBuffer.java | 2 +-
 webapps/docs/changelog.xml                           | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http11/Http11InputBuffer.java b/java/org/apache/coyote/http11/Http11InputBuffer.java
index e6255dd..81a3a5a 100644
--- a/java/org/apache/coyote/http11/Http11InputBuffer.java
+++ b/java/org/apache/coyote/http11/Http11InputBuffer.java
@@ -624,7 +624,7 @@ public class Http11InputBuffer implements InputBuffer, ApplicationBufferHandler
         while (buffer.hasRemaining() && b != 0x20) {
             b = buffer.get();
         }
-        String result = HeaderUtil.toPrintableString(buffer.array(), buffer.arrayOffset() + startPos, buffer.position() - startPos - 1);
+        String result = HeaderUtil.toPrintableString(buffer.array(), buffer.arrayOffset() + startPos, buffer.position() - startPos);
         if (b != 0x20) {
             // Ran out of buffer rather than found a space
             result = result + "...";
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index bc51e67..ce24492 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -138,6 +138,11 @@
         protocol component of the request line are rejected with a 400 response
         rather than some requests being rejected with a 505 response. (markt)
       </fix>
+      <fix>
+        When generating the error message for an HTTP request with an invalid
+        request line, ensure that all the available data is included in the
+        error message. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org