You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Malinda Kaushalye Kapuruge (JIRA)" <ji...@apache.org> on 2007/10/31 12:41:50 UTC

[jira] Commented: (AXIS2C-731) /util/src/base64.c incorrect calculation of length in 'axutil_base64_decode_len'

    [ https://issues.apache.org/jira/browse/AXIS2C-731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539057 ] 

Malinda Kaushalye Kapuruge commented on AXIS2C-731:
---------------------------------------------------

I've tested the code. It worked fine for * security scenarios where the base64 is in use. And it interoped with WCF (thanks Manjula). So Im confident and will commit it. 

> /util/src/base64.c incorrect calculation of length in 'axutil_base64_decode_len'
> --------------------------------------------------------------------------------
>
>                 Key: AXIS2C-731
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-731
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: util
>            Reporter: Mark Nüßler
>
> 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;
> } 

-- 
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: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org