]> granicus.if.org Git - apache/commitdiff
mod_proxy: follow up to r1729826 + r1729847 + r1732986.
authorYann Ylavic <ylavic@apache.org>
Tue, 1 Mar 2016 12:35:01 +0000 (12:35 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 1 Mar 2016 12:35:01 +0000 (12:35 +0000)
Don't use magic constants.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1733056 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy.h
modules/proxy/proxy_util.c

index c9eac3fdade63072350ec59a9cae21a5ea469ff2..6af2457cbdd4cf052642686fa54c115d22179fad 100644 (file)
@@ -349,6 +349,11 @@ PROXY_WORKER_HC_FAIL )
 #define PROXY_BALANCER_MAX_HOSTNAME_SIZE 64
 #define PROXY_BALANCER_MAX_STICKY_SIZE   64
 
+/* RFC-1035 mentions limits of 255 for host-names and 253 for domain-names,
+ * dotted together(?) this would fit the below size (+ trailing NUL).
+ */
+#define PROXY_WORKER_RFC1035_NAME_SIZE   512
+
 #define PROXY_MAX_PROVIDER_NAME_SIZE     16
 
 #define PROXY_STRNCPY(dst, src) ap_proxy_strncpy((dst), (src), (sizeof(dst)))
index add981f4a6bc09db5887b381e907b4fb4b28b360..30d8785a3200254c9aab09e507303102814b9b4c 100644 (file)
@@ -2721,7 +2721,7 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function,
              * restore any ssl_hostname for this connection set earlier by
              * ap_proxy_determine_connection().
              */
-            char ssl_hostname[512]; /* host+domain names max (rfc1035-2.3.4) */
+            char ssl_hostname[PROXY_WORKER_RFC1035_NAME_SIZE];
             if (!conn->ssl_hostname || PROXY_STRNCPY(ssl_hostname,
                                                      conn->ssl_hostname)) {
                 ssl_hostname[0] = '\0';