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

Unified Diff: chrome/browser/policy/configuration_policy_handler.cc

Issue 9705042: Fix segfault in RestoreOnStartupPolicyHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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: chrome/browser/policy/configuration_policy_handler.cc
diff --git a/chrome/browser/policy/configuration_policy_handler.cc b/chrome/browser/policy/configuration_policy_handler.cc
index ec51386e2d7c9e9d3e0fc8f1b22f55b1d94a6b22..6d6203e94b3995199c253a2b31404eba092b963d 100644
--- a/chrome/browser/policy/configuration_policy_handler.cc
+++ b/chrome/browser/policy/configuration_policy_handler.cc
@@ -997,28 +997,27 @@ bool RestoreOnStartupPolicyHandler::CheckPolicySettings(
if (restore_policy->GetAsInteger(&restore_value) &&
SessionStartupPref::PrefValueToType(restore_value) ==
SessionStartupPref::LAST) {
+
const base::Value* cookies_policy =
policies.GetValue(key::kCookiesSessionOnlyForUrls);
- const base::Value* exit_policy =
- policies.GetValue(key::kClearSiteDataOnExit);
-
const base::ListValue *cookies_value;
- if (cookies_policy->GetAsList(&cookies_value) &&
+ if (cookies_policy && cookies_policy->GetAsList(&cookies_value) &&
!cookies_value->empty()) {
errors->AddError(key::kCookiesSessionOnlyForUrls,
IDS_POLICY_OVERRIDDEN,
key::kRestoreOnStartup);
}
+ const base::Value* exit_policy =
+ policies.GetValue(key::kClearSiteDataOnExit);
bool exit_value;
- if (exit_policy->GetAsBoolean(&exit_value) && exit_value) {
+ if (exit_policy && exit_policy->GetAsBoolean(&exit_value) && exit_value) {
errors->AddError(key::kClearSiteDataOnExit,
IDS_POLICY_OVERRIDDEN,
key::kRestoreOnStartup);
}
}
}
-
return true;
}
« 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