Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(669)

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2783743002: Fix nullptr deref in maybeRenderFallbackContent() (Closed)
Patch Set: Rebase, flip was_loading Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index 31776316c9030221eb0e464a4577caf644f0f50b..c30eca8ad06b7506f5784fd044d305ce320c669c 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -2115,8 +2115,11 @@ bool WebLocalFrameImpl::MaybeRenderFallbackContent(
if (!GetFrame()->Owner() || !GetFrame()->Owner()->CanRenderFallbackContent())
return false;
- DCHECK(GetFrame()->Loader().ProvisionalDocumentLoader());
- GetFrame()->Loader().ProvisionalDocumentLoader()->LoadFailed(error);
+ // provisionalDocumentLoader() can be null if a navigation started and
+ // completed (e.g. about:blank) while waiting for the navigation that wants
+ // to show fallback content.
+ if (GetFrame()->Loader().ProvisionalDocumentLoader())
+ GetFrame()->Loader().ProvisionalDocumentLoader()->LoadFailed(error);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698