THRIFT-1205. java: port server unduly fragile with arbitrary input

Increase the default max frame size to 16MB.

Patch: Ryan King

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1156731 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bryan Duxbury 2011-08-11 18:54:11 +00:00
parent 1121b47c09
commit dfffdd8726
2 changed files with 3 additions and 3 deletions

View File

@ -59,9 +59,9 @@ public class TFastFramedTransport extends TTransport {
*/
public static final int DEFAULT_BUF_CAPACITY = 1024;
/**
* How big is the largest allowable frame? Defaults to Integer.MAX_VALUE.
* How big is the largest allowable frame? Defaults to 16MB.
*/
public static final int DEFAULT_MAX_LENGTH = Integer.MAX_VALUE;
public static final int DEFAULT_MAX_LENGTH = 16384000;
private final TTransport underlying;
private final AutoExpandingBufferWriteTransport writeBuffer;

View File

@ -27,7 +27,7 @@ import org.apache.thrift.TByteArrayOutputStream;
*/
public class TFramedTransport extends TTransport {
protected static final int DEFAULT_MAX_LENGTH = 0x7FFFFFFF;
protected static final int DEFAULT_MAX_LENGTH = 16384000;
private int maxLength_;