httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaillet...@apache.org
Subject svn commit: r1716940 - /httpd/httpd/trunk/modules/aaa/mod_auth_basic.c
Date Sat, 28 Nov 2015 06:53:47 GMT
Author: jailletc36
Date: Sat Nov 28 06:53:46 2015
New Revision: 1716940

URL: http://svn.apache.org/viewvc?rev=1716940&view=rev
Log:
Use 'ap_pbase64decode' to simplify code.

Modified:
    httpd/httpd/trunk/modules/aaa/mod_auth_basic.c

Modified: httpd/httpd/trunk/modules/aaa/mod_auth_basic.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_auth_basic.c?rev=1716940&r1=1716939&r2=1716940&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_auth_basic.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_auth_basic.c Sat Nov 28 06:53:46 2015
@@ -250,7 +250,6 @@ static int get_basic_auth(request_rec *r
 {
     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
         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;



Mime
View raw message