41a6c3
--- a/modules/loggers/mod_log_config.c	2013/11/15 17:07:52	1542329
41a6c3
+++ b/modules/loggers/mod_log_config.c	2014/03/10 11:23:47	1575904
41a6c3
@@ -543,14 +543,24 @@
41a6c3
 
41a6c3
         while ((cookie = apr_strtok(cookies, ";", &last1))) {
41a6c3
             char *name = apr_strtok(cookie, "=", &last2);
41a6c3
-            if (name) {
41a6c3
-                char *value = name + strlen(name) + 1;
41a6c3
-                apr_collapse_spaces(name, name);
41a6c3
+            /* last2 points to the next char following an '=' delim,
41a6c3
+               or the trailing NUL char of the string */
41a6c3
+            char *value = last2;
41a6c3
+            if (name && *name &&  value && *value) {
41a6c3
+                char *last = value - 2;
41a6c3
+                /* Move past leading WS */
41a6c3
+                name += strspn(name, " \t");
41a6c3
+                while (last >= name && apr_isspace(*last)) {
41a6c3
+                    *last = '\0';
41a6c3
+                    --last;
41a6c3
+                }
41a6c3
 
41a6c3
                 if (!strcasecmp(name, a)) {
41a6c3
-                    char *last;
41a6c3
-                    value += strspn(value, " \t");  /* Move past leading WS */
41a6c3
-                    last = value + strlen(value) - 1;
41a6c3
+                    /* last1 points to the next char following the ';' delim,
41a6c3
+                       or the trailing NUL char of the string */
41a6c3
+                    last = last1 - (*last1 ? 2 : 1);
41a6c3
+                    /* Move past leading WS */
41a6c3
+                    value += strspn(value, " \t");
41a6c3
                     while (last >= value && apr_isspace(*last)) {
41a6c3
                        *last = '\0';
41a6c3
                        --last;
41a6c3
@@ -559,6 +569,7 @@
41a6c3
                     return ap_escape_logitem(r->pool, value);
41a6c3
                 }
41a6c3
             }
41a6c3
+            /* Iterate the remaining tokens using apr_strtok(NULL, ...) */
41a6c3
             cookies = NULL;
41a6c3
         }
41a6c3
     }