Author: markt Date: Fri Jul 5 18:37:01 2013 New Revision: 1500093 URL: http://svn.apache.org/r1500093 Log: Buffer overflow is fatal on read
Modified: tomcat/trunk/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties Modified: tomcat/trunk/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java?rev=1500093&r1=1500092&r2=1500093&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java Fri Jul 5 18:37:01 2013 @@ -277,9 +277,9 @@ public class AsyncChannelWrapperSecure i read += r.bytesProduced(); Status s = r.getStatus(); - if (s == Status.OK || s == Status.BUFFER_OVERFLOW) { + if (s == Status.OK) { // Bytes available for reading and there may be - // sufficientNeed data in the socketReadBuffer to + // sufficient data in the socketReadBuffer to // support further reads without reading from the // socket } else if (s == Status.BUFFER_UNDERFLOW) { @@ -291,6 +291,13 @@ public class AsyncChannelWrapperSecure i } // else return the data we have and deal with the // partial data on the next read + } else if (s == Status.BUFFER_OVERFLOW) { + // Not enough space in the destination buffer to + // store all of the data + throw new IOException(sm.getString( + "asyncChannelWrapperSecure.readOverflow", + Integer.valueOf(dest.limit()), + Integer.valueOf(dest.position()))); } else { // Status.CLOSED - unexpected throw new IllegalStateException(sm.getString( Modified: tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties?rev=1500093&r1=1500092&r2=1500093&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties Fri Jul 5 18:37:01 2013 @@ -17,6 +17,7 @@ asyncChannelWrapperSecure.closeFail=Fail asyncChannelWrapperSecure.concurrentRead=Concurrent read operations are not permitted asyncChannelWrapperSecure.concurrentWrite=Concurrent write operations are not permitted asyncChannelWrapperSecure.eof=Unexpected end of stream +asyncChannelWrapperSecure.readOverflow=Unable to complete read due to destination buffer overflow. Destination is [{0}] bytes in size and currently contains [{1}] bytes. asyncChannelWrapperSecure.statusUnwrap=Unexpected Status of SSLEngineResult after an unwrap() operation asyncChannelWrapperSecure.statusWrap=Unexpected Status of SSLEngineResult after a wrap() operation asyncChannelWrapperSecure.tooBig=The result [{0}] is too big to be expressed as an Integer --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org