Changeset 69848 in webkit


Ignore:
Timestamp:
Oct 15, 2010 3:39:07 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-10-15 Sergio Villar Senin <svillar@igalia.com>

Reviewed by Xan Lopez.

[GTK] Do a stricter check for invalid base64 dataURLs
https://bugs.webkit.org/show_bug.cgi?id=47717

Restore the strict base64 decoding we added in
https://bugs.webkit.org/show_bug.cgi?id=44261 and then rolled back
in https://bugs.webkit.org/show_bug.cgi?id=47666 due to a failing
test. The actual issue was that we were not finishing the load of
the resource gracefully when an error happened.

Loading invalid base64-encoded data:// URLs are now handled
properly.

  • platform/network/soup/ResourceHandleSoup.cpp: (WebCore::parseDataUrl):
  • platform/network/soup/cache/soup-request-data.c: (webkit_soup_request_data_send):
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r69845 r69848  
     12010-10-15  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        Reviewed by Xan Lopez.
     4
     5        [GTK] Do a stricter check for invalid base64 dataURLs
     6        https://bugs.webkit.org/show_bug.cgi?id=47717
     7
     8        Restore the strict base64 decoding we added in
     9        https://bugs.webkit.org/show_bug.cgi?id=44261 and then rolled back
     10        in https://bugs.webkit.org/show_bug.cgi?id=47666 due to a failing
     11        test. The actual issue was that we were not finishing the load of
     12        the resource gracefully when an error happened.
     13
     14        Loading invalid base64-encoded data:// URLs are now handled
     15        properly.
     16
     17        * platform/network/soup/ResourceHandleSoup.cpp:
     18        (WebCore::parseDataUrl):
     19        * platform/network/soup/cache/soup-request-data.c:
     20        (webkit_soup_request_data_send):
     21
    1222010-10-15  Alejandro G. Castro  <alex@igalia.com>
    223
  • trunk/WebCore/platform/network/soup/ResourceHandleSoup.cpp

    r69748 r69848  
    349349    if (error) {
    350350        d->m_soupRequest = 0;
     351        client->didFinishLoading(handle, 0);
    351352        return false;
    352353    }
     
    355356    if (error) {
    356357        d->m_inputStream = 0;
     358        client->didFinishLoading(handle, 0);
    357359        return false;
    358360    }
  • trunk/WebCore/platform/network/soup/cache/soup-request-data.c

    r69821 r69848  
    9999
    100100                if (base64) {
    101                         buf = g_base64_decode (start, &data->priv->content_length);
     101                        int inlen, state = 0;
     102                        guint save = 0;
    102103
    103                         if (!buf || data->priv->content_length <= 0) {
     104                        inlen = strlen (start);
     105                        buf = g_malloc0 (inlen * 3 / 4 + 3);
     106                        data->priv->content_length =
     107                                g_base64_decode_step (start, inlen, buf,
     108                                                      &state, &save);
     109                        if (state != 0) {
    104110                                g_free (buf);
    105111                                goto fail;
Note: See TracChangeset for help on using the changeset viewer.