From 2ce680b238e4a7d848b9bd05bb228d8da5ff2a9d Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Wed, 22 Jun 2011 04:01:34 +0000 Subject: Coverity: Add a couple return checks to TestingAutomationProvider. BUG=none TEST=none CID=12868,12872 Review URL: http://codereview.chromium.org/7219017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89974 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/automation/testing_automation_provider.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 29ec1c3..7096da1 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -3480,7 +3480,7 @@ webkit_glue::PasswordForm GetPasswordFormFromDict( string16 password_element; string16 submit_element; string16 action_target_text; - bool blacklist = false; + bool blacklist; string16 old_password_element; string16 old_password_value; @@ -3494,7 +3494,8 @@ webkit_glue::PasswordForm GetPasswordFormFromDict( password_dict.GetString("password_element", &password_element); password_dict.GetString("submit_element", &submit_element); password_dict.GetString("action_target", &action_target_text); - password_dict.GetBoolean("blacklist", &blacklist); + if (!password_dict.GetBoolean("blacklist", &blacklist)) + blacklist = false; GURL origin_gurl(origin_url_text); GURL action_target(action_target_text); @@ -4679,7 +4680,8 @@ std::vector TestingAutomationProvider::GetCreditCardsFromList( int num_credit_cards = cards.GetSize(); for (int i = 0; i < num_credit_cards; i++) { - cards.GetDictionary(i, &card_info); + if (!cards.GetDictionary(i, &card_info)) + continue; CreditCard card; // Loop through the possible credit card fields and add those provided. for (std::map::iterator type_it = -- cgit v1.1