apr_base64_decode_len() already accounts for the NUL byte, and
apr_base64_decode() already NUL terminates the string, no need
to do it in ap_pbase64decode().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1883872 13f79535-47bb-0310-9956-
ffa450edef68
AP_DECLARE(char *) ap_pbase64decode(apr_pool_t *p, const char *bufcoded)
{
char *decoded;
- int l;
- decoded = (char *) apr_palloc(p, 1 + apr_base64_decode_len(bufcoded));
- l = apr_base64_decode(decoded, bufcoded);
- decoded[l] = '\0'; /* make binary sequence into string */
+ decoded = (char *) apr_palloc(p, apr_base64_decode_len(bufcoded));
+ apr_base64_decode(decoded, bufcoded);
return decoded;
}