From 410db6c7ced0b9c27e80feedc310626dc0e467bd Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 1 May 2001 21:30:07 +0000 Subject: [PATCH] Fixed a problem with directory listing corruption in the PROXY_DIR filter. PR: Obtained from: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88971 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/proxy_ftp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/proxy/proxy_ftp.c b/modules/proxy/proxy_ftp.c index 114c7e8d44..a6661db7a9 100644 --- a/modules/proxy/proxy_ftp.c +++ b/modules/proxy/proxy_ftp.c @@ -358,7 +358,6 @@ apr_status_t ap_proxy_send_dir_filter(ap_filter_t *f, apr_bucket_brigade *in) char *filename; int found = 0; int eos = 0; - ctx->buffer[0] = 0; /* get a complete line */ /* if the buffer overruns - throw data away */ @@ -457,6 +456,12 @@ apr_status_t ap_proxy_send_dir_filter(ap_filter_t *f, apr_bucket_brigade *in) ctx->buffer, filename, filename); } } + else { + str = apr_pstrdup(p, ctx->buffer); + } + + /* erase buffer for next time around */ + ctx->buffer[0] = 0; e = apr_bucket_pool_create(str, strlen(str), p); APR_BRIGADE_INSERT_TAIL(out, e); -- 2.50.1