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

Unified Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 7031038: Protect against NULL PasswordStore (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment; Check for NULL PasswordStore in TestingAutomationProvider. Created 9 years, 7 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 | « no previous file | chrome/browser/profiles/profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/testing_automation_provider.cc
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index 11b906360478fba8cfdde3b7577fca1b8c3f7d05..9b5edb289baf385b761d3586e658c3e520ba9242 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -3606,7 +3606,10 @@ void TestingAutomationProvider::RemoveSavedPassword(
// Use EXPLICIT_ACCESS since passwords can be removed in incognito mode.
PasswordStore* password_store =
profile->GetPasswordStore(Profile::EXPLICIT_ACCESS);
-
+ if (password_store == NULL) {
+ reply.SendError("Unable to get password store.");
James Hawkins 2011/05/20 22:28:18 This is likely more useful as LOG(ERROR), here and
+ return;
+ }
password_store->RemoveLogin(to_remove);
reply.SendSuccess(NULL);
}
@@ -3623,6 +3626,11 @@ void TestingAutomationProvider::GetSavedPasswords(
// incognito mode.
PasswordStore* password_store =
profile->GetPasswordStore(Profile::EXPLICIT_ACCESS);
+ if (password_store == NULL) {
+ AutomationJSONReply reply(this, reply_message);
+ reply.SendError("Unable to get password store.");
+ return;
+ }
password_store->GetAutofillableLogins(
new AutomationProviderGetPasswordsObserver(this, reply_message));
// Observer deletes itself after returning.
« no previous file with comments | « no previous file | chrome/browser/profiles/profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698