harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stepan Mishura (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-1513) [classlib][luni] Base64 fails on empty input.
Date Thu, 21 Sep 2006 10:10:24 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-1513?page=comments#action_12436488 ] 
            
Stepan Mishura commented on HARMONY-1513:
-----------------------------------------

Alexander, could you comment added check?
     public static byte[] decode(byte[] in, int len) {
         // approximate output length
         int length = len / 4 * 3;
+        if (length == 0) {
+            return new byte[0];
+        }

It works not only for empty input (len==0) but also for len=1,2 and 3

> [classlib][luni] Base64 fails on empty input.
> ---------------------------------------------
>
>                 Key: HARMONY-1513
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1513
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexander Kleymenov
>         Assigned To: Stepan Mishura
>         Attachments: patch-base64.txt
>
>
> Current Base64 decoding implementation fails with ArrayIndexOutOfBoundsException on empty
input.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message