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

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

Issue 1580983002: Fix the dynamic browser action setIcon path to work with any size icon. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move size validation Created 4 years, 11 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
Index: chrome/browser/extensions/extension_action.cc
diff --git a/chrome/browser/extensions/extension_action.cc b/chrome/browser/extensions/extension_action.cc
index 106ed3a054f125fca3d2f8041c9e3fb307040446..c70cdb5fe120c9e0f1e8142ae416bdde7c037ae0 100644
--- a/chrome/browser/extensions/extension_action.cc
+++ b/chrome/browser/extensions/extension_action.cc
@@ -130,8 +130,10 @@ bool ExtensionAction::ParseIconFromCanvasDictionary(
for (base::DictionaryValue::Iterator iter(dict); !iter.IsAtEnd();
iter.Advance()) {
int icon_size = 0;
- if (!base::StringToInt(iter.key(), &icon_size))
+ if (!base::StringToInt(iter.key(), &icon_size) || icon_size <= 0 ||
+ icon_size > 1024) {
Devlin 2016/01/22 23:41:40 nit: in your other CL, you use GIGANTOR * 4. We s
Evan Stade 2016/01/23 00:03:25 Admittedly, 1024 is somewhat arbitrary. But why ma
continue;
+ }
const base::BinaryValue* image_data;
std::string binary_string64;

Powered by Google App Engine
This is Rietveld 408576698