[jboss-cvs] jboss-seam/src/main/org/jboss/seam/web ...

Shane Bryzak sbryzak at redhat.com
Wed May 16 22:33:06 EDT 2007


  User: sbryzak2
  Date: 07/05/16 22:33:06

  Modified:    src/main/org/jboss/seam/web  MultipartRequest.java
  Log:
  JBSEAM-1323
  
  Revision  Changes    Path
  1.12      +4 -1      jboss-seam/src/main/org/jboss/seam/web/MultipartRequest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MultipartRequest.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/web/MultipartRequest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- MultipartRequest.java	17 May 2007 00:36:38 -0000	1.11
  +++ MultipartRequest.java	17 May 2007 02:33:06 -0000	1.12
  @@ -374,9 +374,11 @@
                     }
                     case DATA:
                     {
  +                     // If we've encountered another boundary...
                        if (checkSequence(buffer, i - boundaryMarker.length - CR_LF.length, CR_LF) &&
                            checkSequence(buffer, i, boundaryMarker))
                        {
  +                        // Write any data before the boundary (that hasn't already been written) to the param
                           if (pos < i - boundaryMarker.length - CR_LF.length - 1)
                           {
                             p.appendData(buffer, pos, i - pos - boundaryMarker.length - CR_LF.length - 1);
  @@ -396,6 +398,7 @@
                           
                           readState = ReadState.HEADERS;
                        }
  +                     // Otherwise write whatever data we have to the param
                        else if (i > (pos + boundaryMarker.length + CHUNK_SIZE + CR_LF.length))
                        {
                           p.appendData(buffer, pos, CHUNK_SIZE);
  @@ -456,7 +459,7 @@
       */
      private boolean checkSequence(byte[] data, int pos, byte[] seq)
      {
  -      if (pos - seq.length < 0 || pos >= data.length)
  +      if (pos - seq.length < -1 || pos >= data.length)
            return false;
         
         for (int i = 0; i < seq.length; i++)
  
  
  



More information about the jboss-cvs-commits mailing list