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/04/11 15:42:36 UTC
[tomcat] 03/03: Fix parameter counting logic
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
commit d53d8e7f77042cc32a3b98f589496a1ef5088e38
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Apr 11 16:41:44 2023 +0100
Fix parameter counting logic
---
java/org/apache/tomcat/util/http/Parameters.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/tomcat/util/http/Parameters.java b/java/org/apache/tomcat/util/http/Parameters.java
index d4cc5868b1..debf968acf 100644
--- a/java/org/apache/tomcat/util/http/Parameters.java
+++ b/java/org/apache/tomcat/util/http/Parameters.java
@@ -201,13 +201,13 @@ public final class Parameters {
return;
}
- parameterCount++;
- if (limit > -1 && parameterCount > limit) {
+ if (limit > -1 && parameterCount >= limit) {
// Processing this parameter will push us over the limit. ISE is
// what Request.parseParts() uses for requests that are too big
setParseFailedReason(FailReason.TOO_MANY_PARAMETERS);
throw new IllegalStateException(sm.getString("parameters.maxCountFail", Integer.valueOf(limit)));
}
+ parameterCount++;
paramHashValues.computeIfAbsent(key, k -> new ArrayList<>(1)).add(value);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org