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

Unified Diff: components/update_client/utils.cc

Issue 1876573002: Component updater must enforce that the brand length is 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@apchange
Patch Set: Created 4 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
« no previous file with comments | « components/update_client/utils.h ('k') | components/update_client/utils_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/utils.cc
diff --git a/components/update_client/utils.cc b/components/update_client/utils.cc
index 00123f450d3988c505941ffdc2350c29d5f17931..236c27071c7eac9120218dbfc479944986db00ab 100644
--- a/components/update_client/utils.cc
+++ b/components/update_client/utils.cc
@@ -231,7 +231,7 @@ bool VerifyFileHash256(const base::FilePath& filepath,
bool IsValidBrand(const std::string& brand) {
const size_t kMaxBrandSize = 4;
- if (brand.size() > kMaxBrandSize)
+ if (!brand.empty() && brand.size() != kMaxBrandSize)
return false;
return std::find_if_not(brand.begin(), brand.end(), [](char ch) {
« no previous file with comments | « components/update_client/utils.h ('k') | components/update_client/utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698