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

Unified Diff: components/autofill/core/browser/personal_data_manager.cc

Issue 2732913004: Post fix of CL "declare a variable before using it" (Closed)
Patch Set: Created 3 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/personal_data_manager.cc
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
index af62c8548cc24498ae51862960c1190a67bfe488..c1de29ec01614b069540c95eedb520958e501a07 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -880,7 +880,9 @@ std::vector<Suggestion> PersonalDataManager::GetProfileSuggestions(
// trial group or SIZE_MAX if no limit is defined.
std::string limit_str = variations::GetVariationParamValue(
kFrecencyFieldTrialName, kFrecencyFieldTrialLimitParam);
- size_t limit;
+ size_t limit = SIZE_MAX;
+ // Reassign SIZE_MAX to |limit| is needed after calling base::StringToSizeT,
+ // as this method can modify |limit| even if it returns false.
if (!base::StringToSizeT(limit_str, &limit))
limit = SIZE_MAX;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698