httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r571414 - in /httpd/httpd/trunk: CHANGES modules/proxy/mod_proxy_connect.c
Date Fri, 31 Aug 2007 10:14:05 GMT
Author: niq
Date: Fri Aug 31 03:13:59 2007
New Revision: 571414

URL: http://svn.apache.org/viewvc?rev=571414&view=rev
Log:
Fix potential proxy segfault
PR 40756.  Patch adapted from 2.0 patch by Trevin Beattie

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=571414&r1=571413&r2=571414&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Fri Aug 31 03:13:59 2007
@@ -1,6 +1,9 @@
                                                         -*- coding: utf-8 -*-
 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.
      PR 43167 [Francisco Gimeno <kikov kikov.org>
 

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c?rev=571414&r1=571413&r2=571414&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c Fri Aug 31 03:13:59 2007
@@ -125,18 +125,24 @@
 
     /* are we connecting directly, or via a proxy? */
     if (proxyname) {
-    connectname = proxyname;
-    connectport = proxyport;
+        connectname = proxyname;
+        connectport = proxyport;
         err = apr_sockaddr_info_get(&connect_addr, proxyname, APR_UNSPEC, proxyport,
0, p);
     }
     else {
-    connectname = uri.hostname;
-    connectport = uri.port;
-    connect_addr = uri_addr;
+        connectname = uri.hostname;
+        connectport = uri.port;
+        connect_addr = uri_addr;
     }
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
          "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 */
     if (OK != ap_proxy_checkproxyblock(r, conf, uri_addr)) {
     return ap_proxyerror(r, HTTP_FORBIDDEN,



Mime
View raw message