Konstantin,

On 3/21/13 10:18 AM, Konstantin Kolinko wrote:
> 2013/3/21 Christopher Schultz <ch...@christopherschultz.net>:
>> Konstantin,
>>
>> On 3/19/13 6:09 AM, Konstantin Kolinko wrote:
>>>>          } else if (data[end - 1] == PADDING) {
>>>> -            b1 = DECODING_TABLE[data[end - 4]];
>>>> -            b2 = DECODING_TABLE[data[end - 3]];
>>>> -            b3 = DECODING_TABLE[data[end - 2]];
>>>> +            b1 = DECODING_TABLE[data[end - MASK_4BITS]];
>>>> +            b2 = DECODING_TABLE[data[end - BYTES_PER_UNENCODED_BLOCK]];
>>>> +            b3 = DECODING_TABLE[data[end - MASK_2BITS]];
>>>
>>>
>>> ??? (A question to commons team though).
>>>
>>> I do not know FileUpload code, but from my generic knowledge of base64,
>>> the above replacement is suspicious.
>>>
>>> I think the above replacement of 2,3,4 with constants is incorrect.
>>> They are just indexes in the table.
>>
>> +1
>>
>> The code will still run properly but if the constants were ever to be
>> changed (which they shouldn't!), chaos would ensue. It's also misleading
>> to read the code.
>>
> 
> This particular change has been reverted in Commons Fileupload in one
> of subsequent commits [1], which Mark picked up in subsequent merges.
> The final patch that was ported to Tomcat 7 did not have anything of
> the above.

Sorry for the noise... just catching up on the dev list this morning.

-chris

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to