--- java/org/apache/tomcat/util/http/fileupload/MultipartStream.java.orig 2016-06-27 11:26:04.561937786 -0400 +++ java/org/apache/tomcat/util/http/fileupload/MultipartStream.java 2016-06-27 11:24:26.556751185 -0400 @@ -282,11 +282,10 @@ public class MultipartStream { byte[] boundary, int bufSize, ProgressNotifier pNotifier) { - this.input = input; - this.bufSize = bufSize; - this.buffer = new byte[bufSize]; - this.notifier = pNotifier; + if (boundary == null) { + throw new IllegalArgumentException("boundary may not be null"); + } // We prepend CR/LF to the boundary to chop trailing CR/LF from // body-data tokens. this.boundaryLength = boundary.length + BOUNDARY_PREFIX.length; @@ -294,6 +293,12 @@ public class MultipartStream { throw new IllegalArgumentException( "The buffer size specified for the MultipartStream is too small"); } + + this.input = input; + this.bufSize = Math.max(bufSize, boundaryLength*2); + this.buffer = new byte[this.bufSize]; + this.notifier = pNotifier; + this.boundary = new byte[this.boundaryLength]; this.keepRegion = this.boundary.length; --- webapps/docs/changelog.xml.orig 2016-06-27 11:26:15.578958762 -0400 +++ webapps/docs/changelog.xml 2016-06-27 11:25:26.024864412 -0400 @@ -57,6 +57,16 @@ They eventually become mixed with the numbered issues. (I.e., numbered issues do not "pop up" wrt. others). --> +
+ + + + Update the internal fork of Commons File Upload to r1743698 (1.3.1 plus + additional fixes). (markt) + + + +