httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1404625 - in /httpd/httpd/trunk: CHANGES modules/proxy/mod_proxy_ftp.c
Date Thu, 01 Nov 2012 15:02:46 GMT
Author: jim
Date: Thu Nov  1 15:02:46 2012
New Revision: 1404625

URL: http://svn.apache.org/viewvc?rev=1404625&view=rev
Log:
  *) mod_proxy_ftp: Fix segfaults on IPv4 requests to hosts with DNS AAAA records.
     PR  40841. [Andrew Rucker Jones <arjones simultan dyndns org>,
     <ast domdv de>, Jim Jagielski]

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

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1404625&r1=1404624&r2=1404625&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Thu Nov  1 15:02:46 2012
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_proxy_ftp: Fix segfaults on IPv4 requests to hosts with DNS AAAA records.
+     PR  40841. [Andrew Rucker Jones <arjones simultan dyndns org>,
+     <ast domdv de>, Jim Jagielski]
+
   *) ap_expr: Add req_novary function that allows HTTP header lookups
      without adding the name to the Vary header. [Stefan Fritsch]
 

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c?rev=1404625&r1=1404624&r2=1404625&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c Thu Nov  1 15:02:46 2012
@@ -1411,7 +1411,7 @@ static int proxy_ftp_handler(request_rec
                 ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
                               "EPSV contacting remote host on port %d", data_port);
 
-                if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM,
0, r->pool)) != APR_SUCCESS) {
+                if ((rv = apr_socket_create(&data_sock, origin->client_addr->family,
SOCK_STREAM, 0, r->pool)) != APR_SUCCESS) {
                     ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01040)
                                   "error creating EPSV socket");
                     proxy_ftp_cleanup(r, backend);
@@ -1436,8 +1436,13 @@ static int proxy_ftp_handler(request_rec
                 /* make the connection */
                 apr_socket_addr_get(&data_addr, APR_REMOTE, sock);
                 apr_sockaddr_ip_get(&data_ip, data_addr);
-                apr_sockaddr_info_get(&epsv_addr, data_ip, connect_addr->family, data_port,
0, p);
-                rv = apr_socket_connect(data_sock, epsv_addr);
+                apr_sockaddr_info_get(&epsv_addr, data_ip, origin->client_addr->family,
data_port, 0, p);
+                if (!data_sock)
+                    rv = APR_ENOSOCKET;
+                else if (!epsv_addr)
+                    rv = APR_EBADIP;
+                else
+                    rv = apr_socket_connect(data_sock, epsv_addr);
                 if (rv != APR_SUCCESS) {
                     ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01043)
                                   "EPSV attempt to connect to %pI failed - "



Mime
View raw message