This is an automated email from the ASF dual-hosted git repository. remm 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 c8ecf85eed Use parts size for maxParameterCount c8ecf85eed is described below commit c8ecf85eed4b395fdba34b73b9265d425058caa3 Author: remm <r...@apache.org> AuthorDate: Tue Aug 8 13:23:35 2023 +0200 Use parts size for maxParameterCount If parsing the parts first (which is usually not what happens), then the parts count should affect maxParameterCount. Since the resource use of parameters is small, allowing maxParameterCount parameters in addition to the parts is not a noticeable issue. Parsing parameters first is recommended though. Report submitted by Matus Madzin. --- java/org/apache/catalina/connector/Request.java | 6 +++++- webapps/docs/changelog.xml | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/connector/Request.java b/java/org/apache/catalina/connector/Request.java index 8094e7e565..4cea6996f1 100644 --- a/java/org/apache/catalina/connector/Request.java +++ b/java/org/apache/catalina/connector/Request.java @@ -3045,7 +3045,11 @@ public class Request implements HttpServletRequest { boolean success = false; try { // Set this every time in case limit has been changed via JMX - parameters.setLimit(getConnector().getMaxParameterCount()); + int maxParameterCount = getConnector().getMaxParameterCount(); + if (parts != null && maxParameterCount > 0) { + maxParameterCount -= parts.size(); + } + parameters.setLimit(maxParameterCount); // getCharacterEncoding() may have been overridden to search for // hidden form field containing request encoding diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index e0d84c46fc..d453d4e3b4 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -128,6 +128,11 @@ <bug>66822</bug>: Use the same naming format in log messages for Connector instances as the associated ProtocolHandler instance. (markt) </fix> + <fix> + The parts count should also lower the actual + <code>maxParameterCount</code> used for parsing parameters if parts are + parsed first. (remm) + </fix> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org