Changeset 49627 in webkit


Ignore:
Timestamp:
Oct 15, 2009 7:56:19 AM (15 years ago)
Author:
kov@webkit.org
Message:

2009-10-15 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>

Reviewed by Xan Lopez.

page transition may crash webkit
https://bugs.webkit.org/show_bug.cgi?id=29890

There are actually cases in which a resource may be asked using
webkit_web_view_get_resource after a new load has already been
started, so protect ourselves from crashes in this case.

  • WebCoreSupport/FrameLoaderClientGtk.cpp: (WebKit::FrameLoaderClient::dispatchDidFinishLoading):
  • webkit/webkitwebview.cpp: (webkit_web_view_get_resource):
Location:
trunk/WebKit/gtk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/gtk/ChangeLog

    r49444 r49627  
     12009-10-15  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
     2
     3        Reviewed by Xan Lopez.
     4
     5        page transition may crash webkit
     6        https://bugs.webkit.org/show_bug.cgi?id=29890
     7
     8        There are actually cases in which a resource may be asked using
     9        webkit_web_view_get_resource after a new load has already been
     10        started, so protect ourselves from crashes in this case.
     11
     12        * WebCoreSupport/FrameLoaderClientGtk.cpp:
     13        (WebKit::FrameLoaderClient::dispatchDidFinishLoading):
     14        * webkit/webkitwebview.cpp:
     15        (webkit_web_view_get_resource):
     16
    1172009-10-12  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
    218
  • trunk/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp

    r49284 r49627  
    848848    WebKitWebResource* webResource = webkit_web_view_get_resource(webView, identifierString.get());
    849849
     850    // A NULL WebResource means the load has been interrupted, and
     851    // replaced by another one while this resource was being loaded.
     852    if (!webResource)
     853        return;
     854
    850855    const char* uri = webkit_web_resource_get_uri(webResource);
    851856    RefPtr<ArchiveResource> coreResource(loader->subresource(KURL(KURL(), uri)));
  • trunk/WebKit/gtk/webkit/webkitwebview.cpp

    r49372 r49627  
    38943894    gboolean resourceFound = g_hash_table_lookup_extended(priv->subResources, identifier, NULL, &webResource);
    38953895
    3896     // The only resource we do not store in this hash table is the main!
    3897     g_return_val_if_fail(resourceFound || g_str_equal(identifier, priv->mainResourceIdentifier), NULL);
     3896    // The only resource we do not store in this hash table is the
     3897    // main!  If we did not find a request, it probably means the load
     3898    // has been interrupted while while a resource was still being
     3899    // loaded.
     3900    if (!resourceFound && !g_str_equal(identifier, priv->mainResourceIdentifier))
     3901        return NULL;
    38983902
    38993903    if (!webResource)
Note: See TracChangeset for help on using the changeset viewer.