mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Fix potential proxy segfault
PR 40756. Patch adapted from 2.0 patch by Trevin Beattie git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@571414 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,6 +1,9 @@
|
|||||||
-*- coding: utf-8 -*-
|
-*- coding: utf-8 -*-
|
||||||
Changes with Apache 2.3.0
|
Changes with Apache 2.3.0
|
||||||
|
|
||||||
|
*) mod_proxy_connect: avoid segfault on DNS lookup failure.
|
||||||
|
PR 40756 [Trevin Beattie <tbeattie boingo.com>]
|
||||||
|
|
||||||
*) mod_proxy: enable Ignore Errors option on ProxyPass Status.
|
*) mod_proxy: enable Ignore Errors option on ProxyPass Status.
|
||||||
PR 43167 [Francisco Gimeno <kikov kikov.org>
|
PR 43167 [Francisco Gimeno <kikov kikov.org>
|
||||||
|
|
||||||
|
@@ -125,18 +125,24 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
|
|||||||
|
|
||||||
/* are we connecting directly, or via a proxy? */
|
/* are we connecting directly, or via a proxy? */
|
||||||
if (proxyname) {
|
if (proxyname) {
|
||||||
connectname = proxyname;
|
connectname = proxyname;
|
||||||
connectport = proxyport;
|
connectport = proxyport;
|
||||||
err = apr_sockaddr_info_get(&connect_addr, proxyname, APR_UNSPEC, proxyport, 0, p);
|
err = apr_sockaddr_info_get(&connect_addr, proxyname, APR_UNSPEC, proxyport, 0, p);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
connectname = uri.hostname;
|
connectname = uri.hostname;
|
||||||
connectport = uri.port;
|
connectport = uri.port;
|
||||||
connect_addr = uri_addr;
|
connect_addr = uri_addr;
|
||||||
}
|
}
|
||||||
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
|
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
|
||||||
"proxy: CONNECT: connecting to remote proxy %s on port %d", connectname, connectport);
|
"proxy: CONNECT: connecting to remote proxy %s on port %d", connectname, connectport);
|
||||||
|
|
||||||
|
if (APR_SUCCESS != err) {
|
||||||
|
return ap_proxyerror(r, HTTP_BAD_GATEWAY, apr_pstrcat(p,
|
||||||
|
"DNS lookup failure for: ",
|
||||||
|
uri.hostname, NULL));
|
||||||
|
}
|
||||||
|
|
||||||
/* check if ProxyBlock directive on this host */
|
/* check if ProxyBlock directive on this host */
|
||||||
if (OK != ap_proxy_checkproxyblock(r, conf, uri_addr)) {
|
if (OK != ap_proxy_checkproxyblock(r, conf, uri_addr)) {
|
||||||
return ap_proxyerror(r, HTTP_FORBIDDEN,
|
return ap_proxyerror(r, HTTP_FORBIDDEN,
|
||||||
|
Reference in New Issue
Block a user