On 11/27/20 5:54 PM, yla...@apache.org wrote:
> Author: ylavic
> Date: Fri Nov 27 16:54:50 2020
> New Revision: 1883868
> 
> URL: http://svn.apache.org/viewvc?rev=1883868&view=rev
> Log:
> apr_encode_base32: fix estimated output *len (when called with src == NULL).


If src == NULL we leave immediately with APR_NOTFOUND. How does the below 
change this?

> 
> Modified:
>     apr/apr/trunk/encoding/apr_encode.c
> 
> Modified: apr/apr/trunk/encoding/apr_encode.c
> URL: 
> http://svn.apache.org/viewvc/apr/apr/trunk/encoding/apr_encode.c?rev=1883868&r1=1883867&r2=1883868&view=diff
> ==============================================================================
> --- apr/apr/trunk/encoding/apr_encode.c (original)
> +++ apr/apr/trunk/encoding/apr_encode.c Fri Nov 27 16:54:50 2020
> @@ -665,7 +665,7 @@ APR_DECLARE(apr_status_t) apr_encode_bas
>      }
>  
>      if (len) {
> -        *len = ((slen + 2) / 3 * 4) + 1;
> +        *len = ((slen + 4) / 5 * 8) + 1;

This creates a much larger result. If slen == 1  e.g. 5 vs 9

>      }
>  
>      return APR_SUCCESS;
> 
> 
> 

Regards

RĂ¼diger

Reply via email to