]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r574100 from trunk:
authorJim Jagielski <jim@apache.org>
Wed, 12 Sep 2007 13:19:47 +0000 (13:19 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 12 Sep 2007 13:19:47 +0000 (13:19 +0000)
mod_proxy_ftp: Don't segfault on bad line in FTP listing
PR 40733 [Ulf Harnhammar]

Submitted by: niq
Reviewed by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@574946 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/proxy/mod_proxy_ftp.c

diff --git a/CHANGES b/CHANGES
index ccc8919b6118953b1eb52abbe0ef10b0dd1f6092..7b6d36be32f24994c2c82f8b785f2aff892951b2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.7
 
+  *) mod_proxy_ftp: Don't segfault on bad line in FTP listing
+     PR 40733 [Ulf Harnhammar <metaur telia.com>]
+
   *) mod_proxy: escape error-notes correctly
      PR 40952 [Thijs Kinkhorst <thijs debian.org>]
 
index eac6eff62975f6a738c504bd06d6741a1e3dc88b..1479733542b44bec1735d29ea1dc0c59d871a203 100644 (file)
@@ -517,6 +517,14 @@ static apr_status_t proxy_send_dir_filter(ap_filter_t *f,
             }
 
             filename = strrchr(ctx->buffer, ' ');
+            if (filename == NULL) {
+                /* Line is broken.  Ignore it. */
+                ap_log_error(APLOG_MARK, APLOG_WARNING, 0, r->server,
+                             "proxy_ftp: could not parse line %s", ctx->buffer);
+                /* erase buffer for next time around */
+                ctx->buffer[0] = 0;
+                continue;  /* while state is BODY */
+            }
             *(filename++) = '\0';
 
             /* handle filenames with spaces in 'em */