Author: kkolinko Date: Mon Oct 20 12:34:52 2014 New Revision: 1633128 URL: http://svn.apache.org/r1633128 Log: Do not increase remaining counter at end of stream in IdentityInputFilter. I do not know of a scenario where this results in anything observable, but I think it is safer to fix the arithmetics here.
Modified: tomcat/trunk/java/org/apache/coyote/http11/filters/IdentityInputFilter.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/coyote/http11/filters/IdentityInputFilter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/filters/IdentityInputFilter.java?rev=1633128&r1=1633127&r2=1633128&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http11/filters/IdentityInputFilter.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/filters/IdentityInputFilter.java Mon Oct 20 12:34:52 2014 @@ -118,7 +118,9 @@ public class IdentityInputFilter impleme } else { result = nRead; } - remaining = remaining - nRead; + if (nRead > 0) { + remaining = remaining - nRead; + } } else { // No more bytes left to be read : return -1 and clear the // buffer Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1633128&r1=1633127&r2=1633128&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Mon Oct 20 12:34:52 2014 @@ -177,6 +177,10 @@ <add> Disable SSLv3 by default for the APR/native HTTPS connector. (markt) </add> + <fix> + Do not increase remaining counter at end of stream in + IdentityInputFilter. (kkolinko) + </fix> </changelog> </subsection> <subsection name="Jasper"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org