commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ezra Epstein" <eepst...@irise.com>
Subject RE: codec : Bas64.isArrayByteBase64() issue
Date Tue, 25 Jan 2005 01:27:02 GMT
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.

 


Mime
View raw message