WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
proposed fix
0001-avoid-crashing-in-some-cases-when-a-load-is-replaced.patch (text/plain), 3.18 KB, created by
Gustavo Noronha (kov)
on 2009-10-09 13:15:31 PDT
(
hide
)
Description:
proposed fix
Filename:
MIME Type:
Creator:
Gustavo Noronha (kov)
Created:
2009-10-09 13:15:31 PDT
Size:
3.18 KB
patch
obsolete
>From fe11cd681b37187d1a49baaa7eccf5ef37b68180 Mon Sep 17 00:00:00 2001 >From: Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> >Date: Fri, 9 Oct 2009 17:14:10 -0300 >Subject: [PATCH] avoid crashing in some cases when a load is replaced by another > >--- > WebKit/gtk/ChangeLog | 16 ++++++++++++++++ > WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp | 5 +++++ > WebKit/gtk/webkit/webkitwebview.cpp | 8 ++++++-- > 3 files changed, 27 insertions(+), 2 deletions(-) > >diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog >index 1093e33..ca7fb97 100644 >--- a/WebKit/gtk/ChangeLog >+++ b/WebKit/gtk/ChangeLog >@@ -1,3 +1,19 @@ >+2009-10-09 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-08 Adam Barth <abarth@webkit.org> > > Reviewed by Eric Seidel. >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); >-- >1.6.4.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
xan.lopez
:
review+
gustavo
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 29890
:
40380
| 40962