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

Unified Diff: third_party/WebKit/Source/core/page/CreateWindow.cpp

Issue 2393053002: Fix reentrancy crash in createWindowHelper (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/loading/window-open-onblur-reentrancy-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/CreateWindow.cpp
diff --git a/third_party/WebKit/Source/core/page/CreateWindow.cpp b/third_party/WebKit/Source/core/page/CreateWindow.cpp
index bb5c76e42caeba34757ae0a856d11443b51bc7d0..4630de9a12e355ef22d3bf092ca6192681f2ee22 100644
--- a/third_party/WebKit/Source/core/page/CreateWindow.cpp
+++ b/third_party/WebKit/Source/core/page/CreateWindow.cpp
@@ -160,6 +160,10 @@ static Frame* createWindowHelper(LocalFrame& openerFrame,
}
if (window) {
+ // JS can run inside reuseExistingWindow (via onblur), which can detach
+ // the target window.
+ if (!window->client())
+ return nullptr;
if (request.getShouldSetOpener() == MaybeSetOpener)
window->client()->setOpener(&openerFrame);
return window;
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/loading/window-open-onblur-reentrancy-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698