Bug 54460 - Base64Converter not properly handling bytes with MSB set (not masking byte to int conversion)
Summary: Base64Converter not properly handling bytes with MSB set (not masking byte to...
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.8.4
Hardware: All All
: P2 normal (vote)
Target Milestone: 1.9.0
Assignee: Ant Notifications List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2013-01-22 01:41 UTC by Clive Brettingham-Moore
Modified: 2013-01-23 04:17 UTC (History)
1 user (show)



Attachments
svn diff against trunk. (682 bytes, patch)
2013-01-22 01:41 UTC, Clive Brettingham-Moore
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Clive Brettingham-Moore 2013-01-22 01:41:04 UTC
Created attachment 29875 [details]
svn diff against trunk.

Base64Converter not properly bytes with MSB set (not masking byte to int conversion).

Every 3rd byte taken for conversion (least significant in triplet is not being masked with added to integer, if the msb is set this leads to a signed extension which overwrites the previous two bytes with all ones.

bits24 |= octetString[i++];

Should be:
bits24 |= octetString[i++] & BYTE_MASK;
Comment 1 Antoine Levy-Lambert 2013-01-23 04:17:27 UTC
Thanks for the report and the patch, now submitted in subversion revision 1437268.