REOPEN - /util/src/base64.c incorrect calculation of length in
'axutil_base64_decode_len'
-----------------------------------------------------------------------------------------
Key: AXIS2C-866
URL: https://issues.apache.org/jira/browse/AXIS2C-866
Project: Axis2-C
Issue Type: Bug
Components: util
Affects Versions: 1.2.0
Reporter: Frank Huebbers
Priority: Critical
Hi,
First off, I am opening a new issue here because I don't seem to be able to
reopen case AXIS2C-731 which does not yet seem to be fixed either for the
release candidate 1.2.0 (Take 4) nor on head.
Specifically, it appears as if the proposed bug fix in AXIS2C-731 did not make
it 1-to-1 into CVS. To reiterate, the proposed bug fix was:
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;
}
What actually made it into 1.2.0 and head is the following:
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 + 1;
}
=> Note the "+1" on the return type.
Frank
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]