From ed4536ce7396406759951106445dcf270340b168 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sun, 5 Jan 2014 16:15:38 +0000 Subject: [PATCH] Merge r1551714 from trunk: Avoid sending back uninitialized memory, use 'ftpmessage' in order to have something meaningful instead. Save 8k of stack by the same time. Submitted by: jailletc36 Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1555554 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 10 ---------- modules/proxy/mod_proxy_ftp.c | 3 +-- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/STATUS b/STATUS index c4e874f0a5..af0b6ce3ee 100644 --- a/STATUS +++ b/STATUS @@ -98,16 +98,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_proxy: Remove syntax - trunk patch: http://svn.apache.org/r1552227 - 2.4.x patch: trunk works, except for CHANGES - +1: jailletc36, covener, jim - - * mod_proxy_ftp: Avoid potentially sending back uninitialized memory - and save 8k of stack - trunk patch: http://svn.apache.org/r1551714 - 2.4.x patch: trunk works - +1: jailletc36, covener, jim PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/modules/proxy/mod_proxy_ftp.c b/modules/proxy/mod_proxy_ftp.c index 680be8b802..cf5d513026 100644 --- a/modules/proxy/mod_proxy_ftp.c +++ b/modules/proxy/mod_proxy_ftp.c @@ -975,7 +975,6 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, apr_bucket_brigade *bb = apr_brigade_create(p, c->bucket_alloc); char *buf, *connectname; apr_port_t connectport; - char buffer[MAX_STRING_LEN]; char *ftpmessage = NULL; char *path, *strp, *type_suffix, *cwd = NULL; apr_uri_t uri; @@ -1626,7 +1625,7 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, "Error reading from remote server"); } if (rc != 200) { - return ftp_proxyerror(r, backend, HTTP_BAD_GATEWAY, buffer); + return ftp_proxyerror(r, backend, HTTP_BAD_GATEWAY, ftpmessage); } /* signal that we must use the EPRT/PORT loop */ -- 2.40.0