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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 7981002: Fix crash by preventing extensions from changing their IDs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 9 years, 3 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 | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index d8b7f5f35c5ca7b80afc638c826921d1e09cfb5e..7af3d58a2252f75e60fd69f4864e760d571c2093 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1428,6 +1428,15 @@ void ExtensionService::LoadInstalledExtension(const ExtensionInfo& info,
error = errors::kManifestUnreadable;
}
+ // Once installed, non-unpacked extensions cannot change their IDs (e.g., by
+ // updating the 'key' field in their manifest).
+ if (extension &&
+ extension->location() != Extension::LOAD &&
+ info.extension_id != extension->id()) {
+ error = errors::kCannotChangeExtensionID;
+ extension = NULL;
asargent_no_longer_on_chrome 2011/09/26 22:08:04 It might be good to include a uma histogram here,
jstritar 2011/09/26 22:11:03 Agreed. Do you think we should add a one off histo
+ }
+
if (!extension) {
ReportExtensionLoadError(info.extension_path,
error,
« no previous file with comments | « no previous file | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698