This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit a2e465cfd980b8350656205f1c6515388f5a1612 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 4b7f82d..b8fcee3 100644 --- a/java/org/apache/coyote/http11/Http11InputBuffer.java +++ b/java/org/apache/coyote/http11/Http11InputBuffer.java @@ -638,7 +638,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 a535443..6657c4b 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -134,6 +134,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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org