2012/5/30  <ma...@apache.org>:
> Author: markt
> Date: Wed May 30 13:35:55 2012
> New Revision: 1344253
>
> URL: http://svn.apache.org/viewvc?rev=1344253&view=rev
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53119
> Make sure the buffer is cleared on any error to prevent any possible overflow 
> if it is written to again before the connection is closed.
> I can't reproduce the error with the provided test case but based on code 
> inspection this should fix it.
>
> Modified:
>    tomcat/tc7.0.x/trunk/   (props changed)
>    tomcat/tc7.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
>    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
>
> Propchange: tomcat/tc7.0.x/trunk/
> ------------------------------------------------------------------------------
>  Merged /tomcat/trunk:r1344250
>
> Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1344253&r1=1344252&r2=1344253&view=diff
> ==============================================================================
> --- tomcat/tc7.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java 
> (original)
> +++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Wed 
> May 30 13:35:55 2012
> @@ -288,6 +288,9 @@ public class AjpAprProcessor extends Abs
>
>         if (outputBuffer.position() > 0) {
>             if ((socketRef != 0) && Socket.sendbb(socketRef, 0, 
> outputBuffer.position()) < 0) {
> +                // There are no re-tries so clear the buffer to prevent a
> +                // possible overflow if the buffer is used again. BZ53119.
> +                outputBuffer.clear();
>                 throw new 
> IOException(sm.getString("ajpprocessor.failedsend"));
>             }
>             outputBuffer.clear();
>

Looks good. Backport to 6.0?

AjpNioProcessor#output(byte[], int, int) seems to have the same issue.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to