RFR 8014217: Base64.getXDecoder().wrap(...).read() doesn't throw exception for an incorrect number of padding chars in the final unit

Chris Hegarty chris.hegarty at oracle.com
Tue May 14 19:25:39 UTC 2013


Is there a conflict between the spec and implement? IOE versus IAE?

-Chris

On 14 May 2013, at 19:50, Xueming Shen <xueming.shen at oracle.com> wrote:

> Hi,
> 
> Please help review the change for handling a "malformed base64 stream" corner case.
> The latest spec has been updated/clarified as
> 
> "If there is padding character present in the final unit, the correct number of padding
> character(s) must be present, otherwise IllegalArgumentException is thrown during
> decoding."
> 
> But the stream decoding implementation has not been updated accordingly. The change
> is to throw the IOE if the padding character "=" is missing from the xx== pattern.
> 
> http://cr.openjdk.java.net/~sherman/8014217/webrev/
> 
> Thanks!
> Sherman



More information about the core-libs-dev mailing list