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

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

Issue 6932038: avoid dereferencing NULL extension in ExtensionHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: c Created 9 years, 8 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/extensions/extension_process_manager.cc
diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc
index f21c4f8e0203fba5b9eb0fa1a41542cfdd2a6c64..23a9dc9cb6ea9a3e4073b3aa28a03873e984ef18 100644
--- a/chrome/browser/extensions/extension_process_manager.cc
+++ b/chrome/browser/extensions/extension_process_manager.cc
@@ -291,7 +291,8 @@ void ExtensionProcessManager::Observe(NotificationType type,
for (ExtensionHostSet::iterator iter = background_hosts_.begin();
iter != background_hosts_.end(); ++iter) {
ExtensionHost* host = *iter;
- if (host->extension()->id() == extension->id()) {
+ if (host->extension() == NULL ||
Matt Perry 2011/05/05 17:17:59 This seems a little dangerous to me. Here's an alt
+ host->extension()->id() == extension->id()) {
delete host;
// |host| should deregister itself from our structures.
DCHECK(background_hosts_.find(host) == background_hosts_.end());
« 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