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

Unified Diff: third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp

Issue 2850813004: Add a nullptr check in blink::RequestCallbacks::onSuccess to fix crash. (Closed)
Patch Set: includes 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/modules/credentialmanager/CredentialsContainer.cpp
diff --git a/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp b/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp
index 684815b852c397677a3468274a4d7898d8735306..177edeb149b57c6b6fa7a358a5aece9320d31af2 100644
--- a/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp
+++ b/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp
@@ -89,9 +89,11 @@ class RequestCallbacks : public WebCredentialManagerClient::RequestCallbacks {
~RequestCallbacks() override {}
void OnSuccess(std::unique_ptr<WebCredential> web_credential) override {
- Frame* frame =
- ToDocument(ExecutionContext::From(resolver_->GetScriptState()))
- ->GetFrame();
+ ExecutionContext* context =
+ ExecutionContext::From(resolver_->GetScriptState());
+ if (!context)
+ return;
Mike West 2017/05/03 07:54:31 I think we need to call `resolver_->Clear()` in th
vasilii 2017/05/03 09:05:19 there is no such a method.
+ Frame* frame = ToDocument(context)->GetFrame();
SECURITY_CHECK(!frame || frame == frame->Tree().Top());
std::unique_ptr<WebCredential> credential =

Powered by Google App Engine
This is Rietveld 408576698