markt-asf commented on code in PR #1107:
URL: https://github.com/apache/tomcat/pull/1107#discussion_r4466698941
##########
java/org/apache/tomcat/util/http/parser/ContentRange.java:
##########
@@ -160,9 +167,9 @@ public static ContentRange parse(StringReader input) throws
IOException {
/**
* Validates this content range according to RFC 9110 section 14.4.
*
- * @return {@code true} if start >= 0, end >= start, and length >
end
+ * @return {@code true} if start >= 0, end >= start, and the length
is either unknown or > end
*/
public boolean isValid() {
- return start >= 0 && end >= start && length > end;
+ return start >= 0 && end >= start && (length == -1 || length > end);
Review Comment:
The length check can overflow.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]