Commit b10a4abe authored by asargent@chromium.org's avatar asargent@chromium.org

Fix cause of uninitialized memory read in ExtensionService unit_tests

In crrev.com/113111 I checked in code that reads a app state boolean from an 
ExtensionSyncData object which is uninitialized. This fixes the initialization
for the relevant constructor, and also limits reading that value to only when
the extension is an app.

BUG=106549
TEST=valgrind run of ExtensionService sync-related unit_tests should come back
clean

Review URL: http://codereview.chromium.org/8899010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113926 0039d316-1c4b-4281-b951-d872f2087c98
parent de171202
......@@ -1444,7 +1444,8 @@ void ExtensionService::ProcessExtensionSyncData(
bundle.pending_sync_data[extension_sync_data.id()] = extension_sync_data;
CheckForUpdatesSoon();
}
if (extension_sync_data.notifications_disabled() !=
if (extension_sync_data.type() == Extension::SYNC_TYPE_APP &&
extension_sync_data.notifications_disabled() !=
extension_prefs_->IsAppNotificationDisabled(id)) {
extension_prefs_->SetAppNotificationDisabled(
id, extension_sync_data.notifications_disabled());
......
......@@ -27,7 +27,11 @@ ExtensionSyncData::ExtensionSyncData(const SyncData& sync_data)
}
ExtensionSyncData::ExtensionSyncData(const SyncChange& sync_change)
: uninstalled_(sync_change.change_type() == SyncChange::ACTION_DELETE) {
: uninstalled_(sync_change.change_type() == SyncChange::ACTION_DELETE),
enabled_(false),
incognito_enabled_(false),
type_(Extension::SYNC_TYPE_NONE),
notifications_disabled_(false) {
PopulateFromSyncData(sync_change.sync_data());
}
......
......@@ -5268,12 +5268,6 @@
fun:_ZN5ppapi5proxy38EnterHostFromHostResourceForceCallbackINS_5thunk18PPB_Graphics2D_APIEEC1IN2pp25CompletionCallbackFactoryINS0_20PPB_Graphics2D_ProxyENS0_26ProxyNonThreadSafeRefCountEEEMS8_FviRKNS_12HostResourceEESB_EESD_RT_T0_RKT1_
fun:_ZN5ppapi5proxy20PPB_Graphics2D_Proxy14OnHostMsgFlushERKNS_12HostResourceE
}
{
bug_106549
Memcheck:Uninitialized
fun:_ZN16ExtensionService24ProcessExtensionSyncDataERK17ExtensionSyncDataRNS_10SyncBundleE
fun:_ZN16ExtensionService18ProcessSyncChangesERKN15tracked_objects8LocationERKSt6vectorI10SyncChangeSaIS5_EE
}
{
bug_106552
Memcheck:Uninitialized
......
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