You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gary Gregory <gg...@seagullsoftware.com> on 2005/01/25 02:52:47 UTC

RE: [codec] Base64.isArrayByteBase64() issue (WAS: codec : Bas64.isArrayByteBase64() issue)

Hello Ezra:

 

Yes, it would be great if you could provide a unit test patch when you
submit a bug report. This is more effective than me or another codec
volunteer recreating the issue from scratch.

 

It would be best to for you to create a Bugzilla issue when you want to
report an issue in order to make sure it does not get lost.

 

Thank you,

Gary

 

________________________________

From: Ezra Epstein [mailto:eepstein@irise.com] 
Sent: Monday, January 24, 2005 5:27 PM
To: commons-dev@jakarta.apache.org
Subject: RE: codec : Bas64.isArrayByteBase64() issue

 

Oooops.  Wrong patch file.  Correct one is attached.

 

= Ezra E.

 

________________________________

From: Ezra Epstein [mailto:eepstein@irise.com]
Sent: Mon 1/24/2005 5:22 PM
To: commons-dev@jakarta.apache.org
Subject: codec : Bas64.isArrayByteBase64() issue

There seem to be 2 issues. 

1.	Only 255 byte values are used when creating base64Alphabet, but
there are 256 possible values 
2.	octect (shouldn't that be octet ?) isn't shifted despite the
fact that Java uses unsigned bytes.  It is used unchanged as on offset
into an array (zero based).

As a result I can produce test cases that cause isBase64() to throw
IndexOutOfBounds exceptions.

While at it, I suggest one line be added to discardWhitespace() that
will improve performance under some circumstances (i.e., when there is
no whitespace in the input).

Patch file is attached.Patch file is based on latest version in CVS of
Base64.java file: 1.23

= Ezra E.

P.S., I can provide a jUnit TestCase if that's useful.