From: Christophe Jaillet Date: Sat, 28 Nov 2015 06:53:46 +0000 (+0000) Subject: Use 'ap_pbase64decode' to simplify code. X-Git-Tag: 2.5.0-alpha~2581 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35f0d185a34f0f6b40b272cd470605f8c63efd16;p=thirdparty%2Fapache%2Fhttpd.git Use 'ap_pbase64decode' to simplify code. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1716940 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/aaa/mod_auth_basic.c b/modules/aaa/mod_auth_basic.c index 3e3da35dbc7..d0986940099 100644 --- a/modules/aaa/mod_auth_basic.c +++ b/modules/aaa/mod_auth_basic.c @@ -250,7 +250,6 @@ static int get_basic_auth(request_rec *r, const char **user, { const char *auth_line; char *decoded_line; - int length; /* Get the appropriate header */ auth_line = apr_table_get(r->headers_in, (PROXYREQ_PROXY == r->proxyreq) @@ -275,10 +274,7 @@ static int get_basic_auth(request_rec *r, const char **user, auth_line++; } - decoded_line = apr_palloc(r->pool, apr_base64_decode_len(auth_line) + 1); - length = apr_base64_decode(decoded_line, auth_line); - /* Null-terminate the string. */ - decoded_line[length] = '\0'; + decoded_line = ap_pbase64decode(r->pool, auth_line); *user = ap_getword_nulls(r->pool, (const char**)&decoded_line, ':'); *pw = decoded_line;