]> granicus.if.org Git - apache/commitdiff
Jeff pointed out that the character array must be constant.
authorJustin Erenkrantz <jerenkrantz@apache.org>
Tue, 4 Sep 2001 16:28:45 +0000 (16:28 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Tue, 4 Sep 2001 16:28:45 +0000 (16:28 +0000)
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

server/util_filter.c

index 0c492b6f7a14c6a7ab57a6c11ddc04f6a71f68d7..6c00dd3dd1bb203ea303cb7ce41ea4744a2609c6 100644 (file)
@@ -139,12 +139,17 @@ static ap_filter_t *add_any_filter(const char *name, void *ctx,
 {
     if (reg_filter_set) {
         ap_filter_rec_t *frec;
+        apr_pool_t *p;
         int len = strlen(name);
         int size = len + 1;
-        char name_lower[size];
-        char *dst = name_lower;
+        char *name_lower;
+        char *dst;
         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() */
         do {
             *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,
                                                name_lower, len);
         if (frec) {
-            apr_pool_t *p = r ? r->pool : c->pool;
             ap_filter_t *f = apr_pcalloc(p, sizeof(*f));
             ap_filter_t **outf = r ? r_filters : c_filters;