Commit 1ad9e72d authored by alp@webkit.org's avatar alp@webkit.org
Browse files

2008-11-03 Holger Hans Peter Freyther <zecke@selfish.org>

        Reviewed by Alp Toker.

        https://bugs.webkit.org/show_bug.cgi?id=22041
        Fix CURL crashes on the test suite

        Do not send "no data" to WebCore in parseDataUrl().

        Fixes assert on fast/tokenizer/image-empty-crash.html

        * platform/network/curl/ResourceHandleManager.cpp:
        (WebCore::parseDataUrl):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 515bfc64
2008-11-03 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Alp Toker.
https://bugs.webkit.org/show_bug.cgi?id=22041
Fix CURL crashes on the test suite
Do not send "no data" to WebCore in parseDataUrl().
Fixes assert on fast/tokenizer/image-empty-crash.html
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::parseDataUrl):
2008-11-02 Xan Lopez <xan@gnome.org>
 
Reviewed by Holger Freyther.
......
......@@ -517,12 +517,12 @@ static void parseDataUrl(ResourceHandle* handle)
size_t outLength = 0;
char* outData = 0;
outData = reinterpret_cast<char*>(g_base64_decode(data.utf8().data(), &outLength));
if (outData)
if (outData && outLength > 0)
client->didReceiveData(handle, outData, outLength, 0);
g_free(outData);
#else
Vector<char> out;
if (base64Decode(data.latin1().data(), data.latin1().length(), out))
if (base64Decode(data.latin1().data(), data.latin1().length(), out) && out.size() > 0)
client->didReceiveData(handle, out.data(), out.size(), 0);
#endif
} else {
......@@ -530,6 +530,7 @@ static void parseDataUrl(ResourceHandle* handle)
data = decodeURLEscapeSequences(data, TextEncoding(charset));
response.setTextEncodingName("UTF-16");
client->didReceiveResponse(handle, response);
if (data.length() > 0)
client->didReceiveData(handle, reinterpret_cast<const char*>(data.characters()), data.length() * sizeof(UChar), 0);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment