Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2013-08-05 11:47:24 -0400
committerJoakim Erdfelt2013-08-05 11:47:24 -0400
commite2d872fcc74b002381a733e4089601b668639547 (patch)
tree2555408113528f1d09d22dffd9bcb22c123e723c /jetty-servlets/src
parente15d83e0615a557bf4b345e50ce71059526344a6 (diff)
parent432964cf5fc669fe86fded615ce492e0c3c62d95 (diff)
downloadorg.eclipse.jetty.project-e2d872fcc74b002381a733e4089601b668639547.tar.gz
org.eclipse.jetty.project-e2d872fcc74b002381a733e4089601b668639547.tar.xz
org.eclipse.jetty.project-e2d872fcc74b002381a733e4089601b668639547.zip
Merge branch 'jetty-8'
Conflicts: jetty-server/src/main/java/org/eclipse/jetty/server/handler/RequestLogHandler.java jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java jetty-spdy/spdy-client/pom.xml jetty-spdy/spdy-core/pom.xml jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartInputStreamParser.java jetty-util/src/test/java/org/eclipse/jetty/util/MultiPartInputStreamTest.java pom.xml tests/test-integration/src/test/java/org/eclipse/jetty/test/monitor/JmxServiceTest.java tests/test-integration/src/test/java/org/eclipse/jetty/test/monitor/ProgramConfigTest.java tests/test-integration/src/test/java/org/eclipse/jetty/test/monitor/XmlConfigTest.java
Diffstat (limited to 'jetty-servlets/src')
-rw-r--r--jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java34
1 files changed, 33 insertions, 1 deletions
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java
index 7d70908618..21bec2eb87 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java
@@ -703,7 +703,6 @@ public class MultipartFilterTest
assertTrue(response.getContent().contains("aaaa,bbbbb"));
}
- @Test
public void testContentTypeWithCharSet() throws Exception
{
// generated and parsed test
@@ -733,6 +732,39 @@ public class MultipartFilterTest
assertTrue(response.getContent().indexOf("brown cow")>=0);
}
+
+ @Test
+ public void testBufferOverflowNoCRLF () throws Exception
+ {
+ String boundary="XyXyXy";
+ // generated and parsed test
+ HttpTester request = new HttpTester();
+ HttpTester response = new HttpTester();
+ tester.addServlet(BoundaryServlet.class,"/testb");
+ tester.setAttribute("fileName", "abc");
+ tester.setAttribute("desc", "123");
+ tester.setAttribute("title", "ttt");
+ request.setMethod("POST");
+ request.setVersion("HTTP/1.0");
+ request.setHeader("Host","tester");
+ request.setURI("/context/testb");
+ request.setHeader("Content-Type","multipart/form-data; boundary="+boundary);
+
+ String content = "--XyXyXy";
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ baos.write(content.getBytes());
+
+ for (int i=0; i< 8500; i++) //create content that will overrun default buffer size of BufferedInputStream
+ {
+ baos.write('a');
+ }
+ request.setContent(baos.toString());
+
+ response.parse(tester.getResponses(request.generate()));
+ assertTrue(response.getContent().contains("Buffer size exceeded"));
+ assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, response.getStatus());
+ }
/*
* see the testParameterMap test

Back to the top