Skip to content

Commit

Permalink
Fix parameter counting logic
Browse files Browse the repository at this point in the history
  • Loading branch information
markt-asf committed Apr 11, 2023
1 parent f00b3b9 commit 5badf94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions java/org/apache/tomcat/util/http/Parameters.java
Expand Up @@ -233,13 +233,13 @@ public void addParameter(String key, String value) throws IllegalStateException
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++;

ArrayList<String> values = paramHashValues.get(key);
if (values == null) {
Expand Down

0 comments on commit 5badf94

Please sign in to comment.