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 "Frank Huebbers (JIRA)" <ji...@apache.org> on 2008/01/04 01:02:34 UTC

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

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


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

Posted by "Malinda Kaushalye Kapuruge (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12561603#action_12561603 ] 

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

I prefer the Option #4.


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


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

Posted by "Dinesh Premalal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12563594#action_12563594 ] 

Dinesh Premalal commented on AXIS2C-866:
----------------------------------------

Devs, Can we get this done for 1.2.1 release Or does it take some more time ?

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


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

Posted by "Dinesh Premalal (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-866?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dinesh Premalal reassigned AXIS2C-866:
--------------------------------------

    Assignee: Dinesh Premalal

> 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
>            Assignee: Dinesh Premalal
>            Priority: Critical
>             Fix For: 1.2.1
>
>
> 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: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


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

Posted by "Samisa Abeysinghe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559072#action_12559072 ] 

Samisa Abeysinghe commented on AXIS2C-866:
------------------------------------------

Oops, this is a mishap. I know this patch was applied sometime back, but someone must have overwritten it. Need to have a look into the logs :(

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


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

Posted by "S.Uthaiyashankar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12563808#action_12563808 ] 

S.Uthaiyashankar commented on AXIS2C-866:
-----------------------------------------

this is already done. We can close the issue.

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


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

Posted by "Frank Huebbers (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-866?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Huebbers closed AXIS2C-866.
---------------------------------


Also verified that this works on my end with a snapshot build from 7/2/2008.

> 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
>            Assignee: Dinesh Premalal
>            Priority: Critical
>             Fix For: 1.3.0
>
>
> 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: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


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

Posted by "Dinesh Premalal (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-866?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dinesh Premalal resolved AXIS2C-866.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.2.1

Issue is fixed by Shankar.

> 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
>            Assignee: Dinesh Premalal
>            Priority: Critical
>             Fix For: 1.2.1
>
>
> 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: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


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

Posted by "Dumindu Pallewela (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12561622#action_12561622 ] 

Dumindu Pallewela commented on AXIS2C-866:
------------------------------------------

+1 for option 4.
I don't see a reason why a null termination is needed here. It should be left for the caller to add a null character if he needs it.

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


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

Posted by "S.Uthaiyashankar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12561596#action_12561596 ] 

S.Uthaiyashankar commented on AXIS2C-866:
-----------------------------------------

we have two implementations to decode. They are axutil_base64_decode and axutil_base64_decode_binary.  To create buffer for axutil_base64_decode we need "length + 1" where "length" is the actual decoded length. This is because, axutil_base64_decode appends a null character at the end of the buffer. Hence the +1 in axutil_base64_decode_len.

Option 1: One possible way to overcome this is to have two functions to return the length, namely axutil_base64_decode_len and axutil_base64_decode_binary_len, where axutil_base64_decode_len returns axutil_base64_decode_binary_len + 1. Disadvantage of this is, we have to modify lots of places since axutil_base64_decode_binary is used in lots of places. (axutil_base64_decode is used only in some places in rampart. It is not used in axis2c. Not sure whether other modules use it).

Option 2: Other option is moving +1 part to the code itself. So, if anybody needs to use axutil_base64_decode, then they have to create the buffer with size (axutil_base64_decode_len + 1). Disadvantage is, we might forget this fact in future :-(. 

Option 3: If we can find another function name, which can be linked to axutil_base64_decode, then we can use the function axutil_base64_decode_len linked to axutil_base64_decode_binary. (possibly axutil_base64_decode_nonbinary_len :-) ). In this case, the modifications will be minimum. 

Option 4: since, axutil_base64_decode_binary covers the requirement of axutil_base64_decode, we can remove the method axutil_base64_decode. Since decoded buffer can be non printable characters, is it advantage to add a null character at the end and getting a buffer??  (call to axutil_base64_decode can be changed to axutil_base64_decode_binary in rampart).

which option would be better??

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