]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1716940, r1717086 from trunk:
authorJim Jagielski <jim@apache.org>
Mon, 7 Dec 2015 12:29:46 +0000 (12:29 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 7 Dec 2015 12:29:46 +0000 (12:29 +0000)
Use 'ap_pbase64decode' to simplify code.

Silent a sparse Warning.

cid->ecb->lpszLogData can not be NULL.
It is defined in mod_isapi.h as:
typedef struct EXTENSION_CONTROL_BLOCK {
...
    char           lpszLogData[80];
...
Submitted by: jailletc36
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1718332 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/aaa/mod_auth_basic.c
modules/arch/win32/mod_isapi.c

diff --git a/STATUS b/STATUS
index 3b2bea8bfc124904b50b18b76c2a6089c63d7b83..965543d0fa5162e6c3965c62e5e8be1399079385 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -112,14 +112,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
 
-  *) Easy patches: synch 2.4.x and trunk
-     - mod_auth_basic: Use 'ap_pbase64decode' to simplify code.
-     - mod_isapi: Silent a sparse Warning.
-     trunk patch: http://svn.apache.org/r1716940
-                  http://svn.apache.org/r1717086
-     2.4.x patch: trunk patches work
-     +1: jailletc36, ylavic, jim
-
   *) mod_ssl: Save a few bytes in conf pool.
      trunk patch: http://svn.apache.org/r1715273
      2.4.x patch: trunk patches work
index dc03b43897299e3bad4a56d4147928b1a99dc238..1d72ff681dd834cdfe0bbd9ab70a5837c909ce06 100644 (file)
@@ -254,7 +254,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)
@@ -279,10 +278,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;
index ec0d35e74f529fc022f94901335aca333e7d0461..66cc8da69edc3d0ea77d401b170f8cf96522f76f 100644 (file)
@@ -1582,9 +1582,10 @@ static apr_status_t isapi_handler (request_rec *r)
     rv = (*isa->HttpExtensionProc)(cid->ecb);
 
     /* Check for a log message - and log it */
-    if (cid->ecb->lpszLogData && *cid->ecb->lpszLogData)
+    if (*cid->ecb->lpszLogData) {
         ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02113)
                       "%s: %s", r->filename, cid->ecb->lpszLogData);
+    }
 
     switch(rv) {
         case 0:  /* Strange, but MS isapi accepts this as success */