You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Markus Pallo <ma...@pallo.de> on 2001/06/12 14:12:48 UTC

error in MultipartIterator

Hello,

i have found an error in the method createLocalFile of MultipartIterator.
If the uploaded file contains a \r\n\n sequence there will be a wrong carriage added.

The sequence \r\n\n will change to \r\n\r\n.

The cutCarriage flag will be remembered from the last read if 
readBytes will be 0.

The following diff contains the fix

Index: MultipartIterator.java
===================================================================
RCS file: /home/cvspublic/jakarta-struts/src/share/org/apache/struts/upload/MultipartIterator.java,v
retrieving revision 1.13
diff -r1.13 MultipartIterator.java
499a500
>                                                                                               cutCarriage = false;
504,506d504
<                             }
<                             else {
<                                 cutCarriage = false;



Markus Pallo

Sorry for the wrong indention of the diff, i won't change my emacs settings.......