httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r1030299 - in /httpd/httpd/trunk: CHANGES modules/cache/cache_util.c
Date Wed, 03 Nov 2010 00:16:47 GMT
Author: niq
Date: Wed Nov  3 00:16:47 2010
New Revision: 1030299

URL: http://svn.apache.org/viewvc?rev=1030299&view=rev
Log:
mod_cache: correctly parse quoted strings in cache headers.
PR 50199

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/cache/cache_util.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1030299&r1=1030298&r2=1030299&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Wed Nov  3 00:16:47 2010
@@ -58,6 +58,9 @@ Changes with Apache 2.3.9
      the option to list entry metadata such as sizes and times. [Graham
      Leggett]
 
+  *) mod_cache: correctly parse quoted strings in cache headers.
+     PR 50199 [Nick Kew]
+
   *) mod_cache: Allow control over the base URL of reverse proxied requests
      using the CacheKeyBaseURL directive, so that the cache key can be
      calculated from the endpoint URL instead of the server URL. [Graham

Modified: httpd/httpd/trunk/modules/cache/cache_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/cache_util.c?rev=1030299&r1=1030298&r2=1030299&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_util.c (original)
+++ httpd/httpd/trunk/modules/cache/cache_util.c Wed Nov  3 00:16:47 2010
@@ -761,6 +761,18 @@ CACHE_DECLARE(int) ap_cache_liststr(apr_
                             const char *val_start = next;
                             while (*next && !apr_isspace(*next) &&
                                    (*next != ',')) {
+                                /* EAT QUOTED STRING */
+                                if (*next == '"' || *next == '\'') {
+                                    char delim = *next;
+                                    while (*++next != delim) {
+                                        if (!*next) {
+                                            return 0;
+                                        }
+                                        else if (*next == '\\') {
+                                            ++next;
+                                        }
+                                    }
+                                }
                                 next++;
                             }
                             *val = apr_pstrmemdup(p, val_start,
@@ -777,6 +789,18 @@ CACHE_DECLARE(int) ap_cache_liststr(apr_
 
         /* skip to the next field */
         do {
+            /* EAT QUOTED STRING */
+            if (*next == '"' || *next == '\'') {
+                char delim = *next;
+                while (*++next != delim) {
+                    if (!*next) {
+                        return 0;
+                    }
+                    else if (*next == '\\') {
+                        ++next;
+                    }
+                }
+            }
             next++;
             if (!*next) {
                 return 0;



Mime
View raw message