[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:23:38 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 59a7b98dab7efd34c11a68bbd55f2dec6901174f
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 5 07:42:32 2003 +0000

            Reviewed by Maciej.
    
            - fixed 3164850 -- REGRESSION: query URLs are broken
    
            Mea culpa. The KURL test in the Tests directory failed last time, but for
            some reason I didn't notice that when I ran it, perhaps due to the other
            failing tests.
    
            * kwq/KWQKURL.mm: (appendEscapingBadChars): Don't escape '?' even though
            it is in the "bad character" set, since this is a more-lenient definition
            of bad character. Also fixed a buffer overrun bug in the '%'-sequence-preserving
            code, which is a second way this function is lenient. We still get the speed
            because most characters this routine processes are not bad characters.
            (KURL::encode_string): Instead of calling appendEscapingBadChars, put in
            a strict version of the escaping loop that does not tolerate pre-existing
            '%' sequences or '?' characters.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3572 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index ec55789..d167032 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,24 @@
 2003-02-04  Darin Adler  <darin at apple.com>
 
+        Reviewed by Maciej.
+
+        - fixed 3164850 -- REGRESSION: query URLs are broken
+
+        Mea culpa. The KURL test in the Tests directory failed last time, but for
+        some reason I didn't notice that when I ran it, perhaps due to the other
+        failing tests.
+
+        * kwq/KWQKURL.mm: (appendEscapingBadChars): Don't escape '?' even though
+        it is in the "bad character" set, since this is a more-lenient definition
+        of bad character. Also fixed a buffer overrun bug in the '%'-sequence-preserving
+        code, which is a second way this function is lenient. We still get the speed
+        because most characters this routine processes are not bad characters.
+        (KURL::encode_string): Instead of calling appendEscapingBadChars, put in
+        a strict version of the escaping loop that does not tolerate pre-existing
+        '%' sequences or '?' characters.
+
+2003-02-04  Darin Adler  <darin at apple.com>
+
         Reviewed by Dave.
 
         - rolled in table code fix from Dirk on the khtml-dev list
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index ec55789..d167032 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,24 @@
 2003-02-04  Darin Adler  <darin at apple.com>
 
+        Reviewed by Maciej.
+
+        - fixed 3164850 -- REGRESSION: query URLs are broken
+
+        Mea culpa. The KURL test in the Tests directory failed last time, but for
+        some reason I didn't notice that when I ran it, perhaps due to the other
+        failing tests.
+
+        * kwq/KWQKURL.mm: (appendEscapingBadChars): Don't escape '?' even though
+        it is in the "bad character" set, since this is a more-lenient definition
+        of bad character. Also fixed a buffer overrun bug in the '%'-sequence-preserving
+        code, which is a second way this function is lenient. We still get the speed
+        because most characters this routine processes are not bad characters.
+        (KURL::encode_string): Instead of calling appendEscapingBadChars, put in
+        a strict version of the escaping loop that does not tolerate pre-existing
+        '%' sequences or '?' characters.
+
+2003-02-04  Darin Adler  <darin at apple.com>
+
         Reviewed by Dave.
 
         - rolled in table code fix from Dirk on the khtml-dev list
diff --git a/WebCore/kwq/KWQKURL.mm b/WebCore/kwq/KWQKURL.mm
index 672cc89..beaad2f 100644
--- a/WebCore/kwq/KWQKURL.mm
+++ b/WebCore/kwq/KWQKURL.mm
@@ -715,21 +715,25 @@ QString KURL::decode_string(const QString &urlString)
 static void appendEscapingBadChars(char*& buffer, const char *strStart, size_t length)
 {
     char *p = buffer;
+
     const char *str = strStart;
     const char *strEnd = strStart + length;
-
     while (str < strEnd) {
-	if (*str == '%' && IS_HEX_DIGIT(str[1]) && IS_HEX_DIGIT(str[2])) {
-	    *p++ = *str++;
-	    *p++ = *str++;
-	    *p++ = *str++;
-	} else if (IS_BAD_CHAR(*str)) {
-	    *p++ = '%';
-	    *p++ = hexDigits[(*str >> 4) & 0xF];
-	    *p++ = hexDigits[*str & 0xF];
-	    str++;
+	unsigned char c = *str++;
+        if (IS_BAD_CHAR(c)) {
+            if (c == '%' && strEnd - str >= 2 && IS_HEX_DIGIT(str[0]) && IS_HEX_DIGIT(str[1])) {
+                *p++ = c;
+                *p++ = *str++;
+                *p++ = *str++;
+            } else if (c == '?') {
+                *p++ = c;
+            } else {
+                *p++ = '%';
+                *p++ = hexDigits[c >> 4];
+                *p++ = hexDigits[c & 0xF];
+            }
 	} else {
-	    *p++ = *str++;
+	    *p++ = c;
 	}
     }
     
@@ -1162,7 +1166,19 @@ QString KURL::encode_string(const QString& notEncodedString)
     }
     
     char *p = buffer;
-    appendEscapingBadChars(p, asUTF8, asUTF8.length());
+
+    const char *str = asUTF8;
+    const char *strEnd = str + asUTF8.length();
+    while (str < strEnd) {
+	unsigned char c = *str++;
+        if (IS_BAD_CHAR(c)) {
+            *p++ = '%';
+            *p++ = hexDigits[c >> 4];
+            *p++ = hexDigits[c & 0xF];
+	} else {
+	    *p++ = c;
+	}
+    }
     
     QString result(buffer, p - buffer);
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list