]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #6295. Multipart parser didn't survive properly from a specific bytes (DOS...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 17 Jan 2011 10:26:09 +0000 (10:26 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 17 Jan 2011 10:26:09 +0000 (10:26 +0000)
svn changeset:16905/svn branch:6.5

src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java

index 38794da9485188dda96252f19660c94e03eeff22..3fd9538fbcdead0f3f830d944a1a6716afeba3e2 100644 (file)
@@ -498,10 +498,20 @@ public abstract class AbstractCommunicationManager implements
                 } else {
                     b = charArray[curBoundaryIndex++];
                     if (curBoundaryIndex == matchedCount) {
-                        matchedCount = 0;
                         curBoundaryIndex = 0;
-                        // next call for getBuffered will return the
-                        // bufferedByte, not from the char array.
+                        if (bufferedByte != charArray[0]) {
+                            // next call for getBuffered will return the
+                            // bufferedByte, not from the char array.
+                            matchedCount = 0;
+                        } else {
+                            /*
+                             * Special case where buffered byte again matches
+                             * the boundaryString. Step over one byte matching
+                             * the boundary.
+                             */
+                            matchedCount = 1;
+                            bufferedByte = -1;
+                        }
                     }
                 }
                 if (b == -1) {