Author: sebb
Date: Thu Mar 21 11:40:56 2013
New Revision: 1459239

URL: http://svn.apache.org/r1459239
Log:
Add test to show code does not exhibit the AOOBE thrown by Java 6

Modified:
    
commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java

Modified: 
commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java
URL: 
http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java?rev=1459239&r1=1459238&r2=1459239&view=diff
==============================================================================
--- 
commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java
 (original)
+++ 
commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java
 Thu Mar 21 11:40:56 2013
@@ -110,6 +110,14 @@ public final class Base64DecoderTestCase
         assertIOException("incorrect padding", "Zg=a");
     }
 
+    // This input causes java.lang.ArrayIndexOutOfBoundsException: 1
+    // in the Java 6 method DatatypeConverter.parseBase64Binary(String)
+    // currently reported as truncated (the last chunk consists just of '=')
+    @Test
+    public void badLength() throws Exception {
+        assertIOException("truncated", "Zm8==");
+    }
+
     private static void assertEncoded(String clearText, String encoded) throws 
Exception {
         byte[] expected = clearText.getBytes(US_ASCII_CHARSET);
 


Reply via email to