[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
kov at webkit.org
kov at webkit.org
Thu Oct 29 20:45:19 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit df69c34f5c55aa586494d4edb56d0a63dd340e3a
Author: kov at webkit.org <kov at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 15 14:56:19 2009 +0000
2009-10-15 Gustavo Noronha Silva <gustavo.noronha at 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):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 2150b82..0db14e5 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,19 @@
+2009-10-15 Gustavo Noronha Silva <gustavo.noronha at 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):
+
2009-10-12 Gustavo Noronha Silva <gustavo.noronha at collabora.co.uk>
Rubber-stamped by Xan Lopez.
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 1cf9aee..7f81367 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -847,6 +847,11 @@ void FrameLoaderClient::dispatchDidFinishLoading(WebCore::DocumentLoader* loader
GOwnPtr<gchar> identifierString(toString(identifier));
WebKitWebResource* webResource = webkit_web_view_get_resource(webView, identifierString.get());
+ // A NULL WebResource means the load has been interrupted, and
+ // replaced by another one while this resource was being loaded.
+ if (!webResource)
+ return;
+
const char* uri = webkit_web_resource_get_uri(webResource);
RefPtr<ArchiveResource> coreResource(loader->subresource(KURL(KURL(), uri)));
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index 3cb6908..03ffb44 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -3893,8 +3893,12 @@ WebKitWebResource* webkit_web_view_get_resource(WebKitWebView* webView, char* id
gboolean resourceFound = g_hash_table_lookup_extended(priv->subResources, identifier, NULL, &webResource);
- // The only resource we do not store in this hash table is the main!
- g_return_val_if_fail(resourceFound || g_str_equal(identifier, priv->mainResourceIdentifier), NULL);
+ // The only resource we do not store in this hash table is the
+ // main! If we did not find a request, it probably means the load
+ // has been interrupted while while a resource was still being
+ // loaded.
+ if (!resourceFound && !g_str_equal(identifier, priv->mainResourceIdentifier))
+ return NULL;
if (!webResource)
return webkit_web_view_get_main_resource(webView);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list