httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From field...@apache.org
Subject svn commit: r571899 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS modules/proxy/mod_proxy_connect.c
Date Sat, 01 Sep 2007 23:46:56 GMT
Author: fielding
Date: Sat Sep  1 16:46:55 2007
New Revision: 571899

URL: http://svn.apache.org/viewvc?rev=571899&view=rev
Log:
mod_proxy_connect: avoid segfault on DNS lookup failure.
PR: 40756
Submitted by: Trevin Beattie <tbeattie boingo.com>

Reviewed by: Nick Kew, Ruediger Pluem, Jim Jagielski, Roy Fielding

Please don't dick with the whitespace while holding up a segfault fix.


Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_connect.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=571899&r1=571898&r2=571899&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Sat Sep  1 16:46:55 2007
@@ -1,6 +1,9 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.6
 
+  *) 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/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=571899&r1=571898&r2=571899&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Sat Sep  1 16:46:55 2007
@@ -175,14 +175,6 @@
       trawick says: The new directives should be documented in trunk,
           so that docs are available for backport at the same time.
 
-   * mod_proxy_connect: Fix potential proxy segfault
-     PR 40756
-     http://svn.apache.org/viewvc?view=rev&revision=571414
-     http://svn.apache.org/viewvc?view=rev&revision=571863
-     http://svn.apache.org/viewvc?view=rev&revision=571869
-     http://svn.apache.org/viewvc?view=rev&revision=571879
-     +1: jim
-
    * mod_include: Add an "if" directive syntax to test whether an URL
      is accessible, and if so, conditionally display content. This
      allows a webmaster to hide a link to a private page when the user

Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_connect.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_connect.c?rev=571899&r1=571898&r2=571899&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_connect.c (original)
+++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_connect.c Sat Sep  1 16:46:55 2007
@@ -122,21 +122,26 @@
 
     /* do a DNS lookup for the destination host */
     err = apr_sockaddr_info_get(&uri_addr, uri.hostname, APR_UNSPEC, uri.port, 0, p);
+    if (APR_SUCCESS != err) {
+	return ap_proxyerror(r, HTTP_BAD_GATEWAY, apr_pstrcat(p,
+			     "DNS lookup failure for: ",
+			     uri.hostname, NULL));
+    }
 
     /* 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);
-
+ 
     /* 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