Commit 634ad17e authored by Justin Erenkrantz's avatar Justin Erenkrantz
Browse files

Jeff pointed out that the character array must be constant.

Well, it's not, so make it allocated from the correct pool rather than
the heap.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90891 13f79535-47bb-0310-9956-ffa450edef68
parent bd71f210
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -139,12 +139,17 @@ static ap_filter_t *add_any_filter(const char *name, void *ctx,
{
{
    if (reg_filter_set) {
    if (reg_filter_set) {
        ap_filter_rec_t *frec;
        ap_filter_rec_t *frec;
        apr_pool_t *p;
        int len = strlen(name);
        int len = strlen(name);
        int size = len + 1;
        int size = len + 1;
        char name_lower[size];
        char *name_lower;
        char *dst = name_lower;
        char *dst;
        const char *src = name;
        const char *src = name;


        p = r ? r->pool : c->pool;
        name_lower = apr_palloc(p, size);
        dst = name_lower;

        /* Normalize the name to all lowercase to match register_filter() */
        /* Normalize the name to all lowercase to match register_filter() */
        do {
        do {
            *dst++ = apr_tolower(*src++);
            *dst++ = apr_tolower(*src++);
@@ -153,7 +158,6 @@ static ap_filter_t *add_any_filter(const char *name, void *ctx,
        frec = (ap_filter_rec_t *)apr_hash_get(reg_filter_set,
        frec = (ap_filter_rec_t *)apr_hash_get(reg_filter_set,
                                               name_lower, len);
                                               name_lower, len);
        if (frec) {
        if (frec) {
            apr_pool_t *p = r ? r->pool : c->pool;
            ap_filter_t *f = apr_pcalloc(p, sizeof(*f));
            ap_filter_t *f = apr_pcalloc(p, sizeof(*f));
            ap_filter_t **outf = r ? r_filters : c_filters;
            ap_filter_t **outf = r ? r_filters : c_filters;