axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dinesh Premalal (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (AXIS2C-731) /util/src/base64.c incorrect calculation of length in 'axutil_base64_decode_len'
Date Thu, 22 Nov 2007 05:47:43 GMT

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

Dinesh Premalal reassigned AXIS2C-731:
--------------------------------------

    Assignee: Dinesh Premalal

> /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
>            Assignee: Dinesh Premalal
>             Fix For: 1.2.0
>
>
> 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


Mime
View raw message