Fix segfault when getting network details.

Segfault occurs in internet_options_handler.cc when accessing a
non-existent policy. This was introduced in https://crrev.com/427903004.

Please note: http://imgur.com/sD3vz0W.jpg

BUG=403111
R=pneubeck@chromium.org
TBR=stevenjb@chromium.org

Review URL: https://codereview.chromium.org/470433002

Cr-Commit-Position: refs/heads/master@{#289201}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289201 0039d316-1c4b-4281-b951-d872f2087c98
parent bca78618
......@@ -1374,13 +1374,17 @@ void InternetOptionsHandler::PopulateDictionaryDetailsCallback(
scoped_ptr<base::Value> auto_connect_value(
new base::FundamentalValue(auto_connect));
::onc::ONCSource auto_connect_onc_source = onc_source;
DCHECK_EQ(onc == NULL, onc_source == ::onc::ONC_SOURCE_NONE);
bool auto_connect_recommended =
auto_connect_onc_source != ::onc::ONC_SOURCE_NONE &&
onc::IsRecommendedValue(onc, onc_path_to_auto_connect);
// |auto_connect_default_value| will contain either a recommended value
// if |auto_connect_recommended| is true, or an enforced value otherwise.
// If a policy exists, |auto_connect_default_value| will contain either a
// recommended value (if |auto_connect_recommended| is true) or an enforced
// value (if |auto_connect_recommended| is false).
const base::Value* auto_connect_default_value = NULL;
onc->Get(onc_path_to_auto_connect, &auto_connect_default_value);
if (onc)
onc->Get(onc_path_to_auto_connect, &auto_connect_default_value);
// Autoconnect can be controlled by the GlobalNetworkConfiguration of the
// ONC policy.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment