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 2023/11/09 08:57:11 UTC
(tomcat) branch main updated: Better message if size limit is reached reading trailer header value
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 870b52f410 Better message if size limit is reached reading trailer header value
870b52f410 is described below
commit 870b52f410468b6155e8bf4bd4aaf8f92ef941a7
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Nov 9 08:46:00 2023 +0000
Better message if size limit is reached reading trailer header value
---
java/org/apache/coyote/http11/filters/ChunkedInputFilter.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java b/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
index fb6df01220..13dcb7d53f 100644
--- a/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
+++ b/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
@@ -566,6 +566,8 @@ public class ChunkedInputFilter implements InputFilter, ApplicationBufferHandler
eol = true;
} else if (HttpParser.isControl(chr) && chr != Constants.HT) {
throw new IOException(sm.getString("chunkedInputFilter.invalidTrailerHeaderValue"));
+ } else if (trailingHeaders.getEnd() >= trailingHeaders.getLimit()) {
+ throwBadRequestException(sm.getString("chunkedInputFilter.maxTrailer"));
} else if (chr == Constants.SP || chr == Constants.HT) {
trailingHeaders.append(chr);
} else {
@@ -591,6 +593,8 @@ public class ChunkedInputFilter implements InputFilter, ApplicationBufferHandler
chr = readChunk.get(readChunk.position());
if (chr != Constants.SP && chr != Constants.HT) {
validLine = false;
+ } else if (trailingHeaders.getEnd() >= trailingHeaders.getLimit()) {
+ throwBadRequestException(sm.getString("chunkedInputFilter.maxTrailer"));
} else {
eol = false;
// Copying one extra space in the buffer (since there must
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org