* modules/proxy/mod_proxy_balancer.c (make_server_id):
authorJoe Orton <jorton@apache.org>
Mon, 23 Jul 2018 08:47:59 +0000 (08:47 +0000)
committerJoe Orton <jorton@apache.org>
Mon, 23 Jul 2018 08:47:59 +0000 (08:47 +0000)
  Fix APR 1.4 compatibility by avoiding use of apr_escape.h.

Submitted by: jorton
Reviewed by: jorton, rpluem, ylavic

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

CHANGES
modules/proxy/mod_proxy_balancer.c

diff --git a/CHANGES b/CHANGES
index 66f49cc622fa3d6ade98f9c6e30754ec42f231ba..35a1469d11f5c5ef8a89f515f341c186725158ee 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.35
 
+  *) mod_proxy_balancer: Restore compatibility with APR 1.4.  [Joe Orton]
+
 Changes with Apache 2.4.34
 
   *) SECURITY: CVE-2018-8011 (cve.mitre.org)
index e0ccc318714ee3208df9c9e2019a3dbdd11e440d..c3c5d83960f3262f301c500ebfe09fa987f54855 100644 (file)
@@ -22,7 +22,7 @@
 #include "apr_version.h"
 #include "ap_hooks.h"
 #include "apr_date.h"
-#include "apr_escape.h"
+#include "util_md5.h"
 #include "mod_watchdog.h"
 
 static const char *balancer_mutex_type = "proxy-balancer-shm";
@@ -740,6 +740,7 @@ static apr_status_t lock_remove(void *data)
 {
     apr_md5_ctx_t md5_ctx;
     unsigned char md5[APR_MD5_DIGESTSIZE];
+    char id[2 * APR_MD5_DIGESTSIZE + 1];
     char host_ip[64]; /* for any IPv[46] string */
     server_addr_rec *sar;
     int i;
@@ -775,8 +776,9 @@ static apr_status_t lock_remove(void *data)
         }
     }
     apr_md5_final(md5, &md5_ctx);
+    ap_bin2hex(md5, APR_MD5_DIGESTSIZE, id);
 
-    return apr_pescape_hex(p, md5, sizeof md5, 0);
+    return apr_pstrmemdup(p, id, sizeof(id) - 1);
 }
 
 /*