Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2013-08-05 16:53:48 +0000
committerJoakim Erdfelt2013-08-05 16:53:48 +0000
commit8636c7da4588db00404a0959b738faa4483f5cdf (patch)
tree6e74dd0878847b4e37f91302740634d7199cc8bd /jetty-servlets
parentdfd3d5af29cb45098266fc32465e94b226867c3d (diff)
parent74991f90d6498aa8c170b768d843c010a1064b09 (diff)
downloadorg.eclipse.jetty.project-8636c7da4588db00404a0959b738faa4483f5cdf.tar.gz
org.eclipse.jetty.project-8636c7da4588db00404a0959b738faa4483f5cdf.tar.xz
org.eclipse.jetty.project-8636c7da4588db00404a0959b738faa4483f5cdf.zip
Merge branch 'master' into jetty-9.1
Conflicts: jetty-maven-plugin/pom.xml pom.xml
Diffstat (limited to 'jetty-servlets')
-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..9098ea3bcf 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 request = HttpTester.newRequest();
+ HttpTester.Response response;
+ 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 = HttpTester.parseResponse(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