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

Unified Diff: webkit/plugins/npapi/plugin_group.cc

Issue 6579004: Don't access WebPluginInfo array out of bounds in PluginGroup::RemovePlugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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 | webkit/plugins/npapi/plugin_group_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/npapi/plugin_group.cc
diff --git a/webkit/plugins/npapi/plugin_group.cc b/webkit/plugins/npapi/plugin_group.cc
index dd2bb1fc7bd9a00f0585e2afac20c156ea704d66..ef6b71814b20d1b357b67abab65b5bab83ddf645 100644
--- a/webkit/plugins/npapi/plugin_group.cc
+++ b/webkit/plugins/npapi/plugin_group.cc
@@ -248,10 +248,11 @@ bool PluginGroup::RemovePlugin(const FilePath& filename) {
ResetGroupState();
for (size_t i = 0; i < web_plugin_infos_.size(); ++i) {
if (web_plugin_infos_[i].path == filename) {
- web_plugin_infos_.erase(web_plugin_infos_.begin() + i);
+ web_plugin_infos_.erase(web_plugin_infos_.begin() + i--);
jam 2011/02/23 19:49:59 nit: usually i've seen this be done by not having
did_remove = true;
+ } else {
+ UpdateActivePlugin(web_plugin_infos_[i]);
}
- UpdateActivePlugin(web_plugin_infos_[i]);
}
return did_remove;
}
« no previous file with comments | « no previous file | webkit/plugins/npapi/plugin_group_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698