File squid-3.0.STABLE5-bug2541-bnc577347.patch of Package squid3

diff -ruN ../squid-3.0.STABLE5.orig/src/HttpHeaderTools.cc ./src/HttpHeaderTools.cc
--- ../squid-3.0.STABLE5.orig/src/HttpHeaderTools.cc	2008-04-29 05:43:30.000000000 +0200
+++ ./src/HttpHeaderTools.cc	2010-03-12 16:41:43.000000000 +0100
@@ -246,6 +246,10 @@
 strListGetItem(const String * str, char del, const char **item, int *ilen, const char **pos)
 {
     size_t len;
+    /* ',' is always enabled as field delimiter as this is required for
+     * processing merged header values properly, even if Cookie normally
+     * uses ';' as delimiter.
+     */
     static char delim[3][8] = {
 			"\"?,",
 			"\"\\",
@@ -273,19 +277,16 @@
     do {
         *pos += strcspn(*pos, delim[quoted]);
 
-        if (**pos == del)
-            break;
-
         if (**pos == '"') {
             quoted = !quoted;
             *pos += 1;
-        }
-
-        if (quoted && **pos == '\\') {
+        } else if (quoted && **pos == '\\') {
             *pos += 1;
 
             if (**pos)
                 *pos += 1;
+        } else {
+            break;              /* Delimiter found, marking the end of this value */
         }
     } while (**pos);
 
openSUSE Build Service is sponsored by