From: Yann Ylavic Date: Thu, 11 Feb 2016 14:57:04 +0000 (+0000) Subject: mod_proxy: follow up to r1729826: really copy conn->ssl_hostname. X-Git-Tag: 2.5.0-alpha~2116 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4a2cbdf69da11b6396679bc8ede80067fb9afd32;p=thirdparty%2Fapache%2Fhttpd.git mod_proxy: follow up to r1729826: really copy conn->ssl_hostname. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729847 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 2be33ccd7bb..6949f2ce0e1 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -2721,14 +2721,20 @@ 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(). */ - const char *ssl_hostname = conn->ssl_hostname; + char ssl_hostname[PROXY_WORKER_MAX_HOSTNAME_SIZE]; + if (!conn->ssl_hostname || PROXY_STRNCPY(ssl_hostname, + conn->ssl_hostname)) { + ssl_hostname[0] = '\0'; + } socket_cleanup(conn); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00951) "%s: backend socket is disconnected.", proxy_function); - conn->ssl_hostname = apr_pstrdup(conn->scpool, ssl_hostname); + if (ssl_hostname[0]) { + conn->ssl_hostname = apr_pstrdup(conn->scpool, ssl_hostname); + } } } while ((backend_addr || conn->uds_path) && !connected) {