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

Unified Diff: chrome/browser/ui/webui/extension_icon_source.cc

Issue 7192020: Sanitize chrome://extension-icon/ URL inputs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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/ui/webui/extension_icon_source.cc
diff --git a/chrome/browser/ui/webui/extension_icon_source.cc b/chrome/browser/ui/webui/extension_icon_source.cc
index 8981179d13862d799b7e1f068e0bd4d0feb31dd3..0bfa3008c1fb055d97ae4d2f52abc36839f372c8 100644
--- a/chrome/browser/ui/webui/extension_icon_source.cc
+++ b/chrome/browser/ui/webui/extension_icon_source.cc
@@ -264,12 +264,18 @@ bool ExtensionIconSource::ParseData(const std::string& path,
if (!base::StringToInt(size_param, &size_num))
return false;
size = static_cast<Extension::Icons>(size_num);
+ if (size <= 0)
+ return false;
ExtensionIconSet::MatchType match_type;
int match_num;
if (!base::StringToInt(match_param, &match_num))
return false;
match_type = static_cast<ExtensionIconSet::MatchType>(match_num);
+ if (!(match_type == ExtensionIconSet::MATCH_EXACTLY ||
+ match_type == ExtensionIconSet::MATCH_SMALLER ||
+ match_type == ExtensionIconSet::MATCH_BIGGER))
+ match_type = ExtensionIconSet::MATCH_EXACTLY;
std::string extension_id = path_parts.at(0);
const Extension* extension =
« 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