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

Unified Diff: chrome/browser/supervised_user/supervised_user_settings_service.cc

Issue 2201373002: Ignore invalid managed user settings values gracefully. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: chrome/browser/supervised_user/supervised_user_settings_service.cc
diff --git a/chrome/browser/supervised_user/supervised_user_settings_service.cc b/chrome/browser/supervised_user/supervised_user_settings_service.cc
index 6628c217b971eae0cc53a31dfcc1dc00efbd5a72..20bd2b174781162404dba78c60447b34c58f0628 100644
--- a/chrome/browser/supervised_user/supervised_user_settings_service.cc
+++ b/chrome/browser/supervised_user/supervised_user_settings_service.cc
@@ -241,6 +241,12 @@ SyncMergeResult SupervisedUserSettingsService::MergeDataAndStartSyncing(
sync_data.GetSpecifics().managed_user_setting();
std::unique_ptr<base::Value> value =
JSONReader::Read(supervised_user_setting.value());
+ if (!value) {
+ LOG(ERROR) << "Invalid managed user setting value:"
Marc Treib 2016/08/03 14:40:32 DLOG please, so the message won't make it into rel
Marc Treib 2016/08/03 14:40:32 nit: Space after : please
mamir 2016/08/03 15:19:36 Done.
mamir 2016/08/03 15:19:36 Done.
+ << supervised_user_setting.value()
+ << ". Values must be JSON values.";
+ continue;
Bernhard Bauer 2016/08/03 14:44:07 Note that even if we compile out the log, we will
mamir 2016/08/03 15:19:36 Done.
+ }
std::string name_suffix = supervised_user_setting.name();
std::string name_key = name_suffix;
base::DictionaryValue* dict = GetDictionaryAndSplitKey(&name_suffix);
« 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