Author: markt
Date: Wed May 30 13:31:51 2012
New Revision: 1344250
URL: http://svn.apache.org/viewvc?rev=1344250&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/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1344250&r1=1344249&r2=1344250&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Wed May 30
13:31:51 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();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]