Bug 17381 - [CURL] Regression: data URL parsing broken after DeprecatedString removal (Acid2)
Summary: [CURL] Regression: data URL parsing broken after DeprecatedString removal (Ac...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: Curl, Gtk
Depends on:
Blocks:
 
Reported: 2008-02-15 16:45 PST by Alp Toker
Modified: 2008-02-18 15:18 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alp Toker 2008-02-15 16:45:32 PST
WebCore/platform/network/curl/ResourceHandleManager.cpp uses String to carry binary data, which doesn't work properly.

The fix will be something along the lines of:

    char* ret = 0;
+    size_t retLen = 0;
+
     if (base64 && !data.isEmpty()) {
         // Use the GLib Base64 if available, since WebCore's decoder isn't
         // general-purpose and fails on Acid3 test 97 (whitespace).
 #ifdef USE_GLIB_BASE64
         gsize outLength;
         guchar* out = g_base64_decode(data.latin1().data(), &outLength);
-        data = String(reinterpret_cast<char*>(out), outLength);
-        g_free(out);
+        //g_free(out);
+        ret = (char*)out;
+        retLen = outLength;
 #else





+    if (retLen)
+        client->didReceiveData(handle, ret, retLen, 0);
Comment 1 Alp Toker 2008-02-18 15:18:02 PST
Fix landed in r30386. parseDataUrl() remains flaky as ever for character encoded URLs but the acid data url tests pass again with this fix.