]> granicus.if.org Git - apache/commitdiff
Fixed a problem with directory listing corruption in the
authorGraham Leggett <minfrin@apache.org>
Tue, 1 May 2001 21:30:07 +0000 (21:30 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 1 May 2001 21:30:07 +0000 (21:30 +0000)
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

index 114c7e8d44c24181ccfece6d309f0d7898745deb..a6661db7a986a422c83f065a113a4b0d556bb3af 100644 (file)
@@ -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);