Description
Royston Day told me in the mailinglist about this issue, some time ago, i've checked this - for me Royston is right.
current implementation :
AXIS2_EXTERN int AXIS2_CALL axutil_base64_decode_len(const char *bufcoded)
{
int nbytesdecoded;
register const unsigned char *bufin;
register int nprbytes;
bufin = (const unsigned char *) bufcoded;
while (pr2six[*(bufin++)] <= 63);
nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
nbytesdecoded = ((nprbytes + 3) / 4) * 3;
return nbytesdecoded + 1;
}
Royston implementation :
AXIS2_EXTERN int AXIS2_CALL axutil_base64_decode_len(const char *bufcoded)
{
int nbytesdecoded;
register const unsigned char *bufin;
register int nprbytes;
bufin = (const unsigned char *) bufcoded;
while (pr2six[*(bufin++)] <= 63);
nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
nbytesdecoded = ((nprbytes >> 2) * 3);
if (nprbytes & 0x03) nbytesdecoded += (nprbytes & 0x03) - 1;
return nbytesdecoded;
}
Attachments
Issue Links
- is blocked by
-
AXIS2C-866 REOPEN - /util/src/base64.c incorrect calculation of length in 'axutil_base64_decode_len'
- Closed