Bug 17381
Summary: | [CURL] Regression: data URL parsing broken after DeprecatedString removal (Acid2) | ||
---|---|---|---|
Product: | WebKit | Reporter: | Alp Toker <alp> |
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | Keywords: | Curl, Gtk |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All |
Alp Toker
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);
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alp Toker
Fix landed in r30386. parseDataUrl() remains flaky as ever for character encoded URLs but the acid data url tests pass again with this fix.