You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2010/06/02 02:27:39 UTC

[jira] Commented: (CODEC-91) Handling of embedded padding in base64 encoded data changed in 1.4

    [ https://issues.apache.org/jira/browse/CODEC-91?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12874333#action_12874333 ] 

Sebb commented on CODEC-91:
---------------------------

The buffer output code when PAD is detected is the same as for the final "if (eof && modulus != 0)".

This does nothing if modulus == 1; I wonder if this is the cause of the behaviour reported above by Raphael, which should probably be a new JIRA.

Seems to me there need to be tests which exercise all possible moduli.

> Handling of embedded padding in base64 encoded data changed in 1.4
> ------------------------------------------------------------------
>
>                 Key: CODEC-91
>                 URL: https://issues.apache.org/jira/browse/CODEC-91
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Chris Pimlott
>         Attachments: codec-91-actually-works-and-tests-yay.patch
>
>
> 1.4 changed the way that embedded padding characters (i.e. "=") were handled when decoding base64 data.  Previously, the decoder ignored them and decoded all the data.  Now it stops upon encountering the first padding byte.  This breaks compatibility with previous versions.
> For example, in 1.4,
> b64.decode("Y29tbW9ucwo=".getBytes());
> gives the same result as
> b64.decode("Y29tbW9ucwo=Y29tbW9ucwo=".getBytes());

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.