Index: extensions/common/manifest_handler_helpers.cc |
diff --git a/extensions/common/manifest_handler_helpers.cc b/extensions/common/manifest_handler_helpers.cc |
index bfc9e3378c4ca9f1f46eb83c30b734e0215dbf9e..9457864fcca4766722ef3d6a4a9308befee79a28 100644 |
--- a/extensions/common/manifest_handler_helpers.cc |
+++ b/extensions/common/manifest_handler_helpers.cc |
@@ -10,6 +10,7 @@ |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/utf_string_conversions.h" |
#include "base/values.h" |
+#include "extensions/common/constants.h" |
#include "extensions/common/error_utils.h" |
#include "extensions/common/extension.h" |
#include "extensions/common/extension_icon_set.h" |
@@ -41,7 +42,8 @@ bool LoadIconsFromDictionary(const base::DictionaryValue* icons_value, |
!iterator.IsAtEnd(); iterator.Advance()) { |
int size = 0; |
std::string icon_path; |
- if (!base::StringToInt(iterator.key(), &size) || |
+ if (!base::StringToInt(iterator.key(), &size) || size <= 0 || |
+ size > extension_misc::EXTENSION_ICON_GIGANTOR * 4 || |
!iterator.value().GetAsString(&icon_path) || |
!NormalizeAndValidatePath(&icon_path)) { |
*error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidIconPath, |
Devlin
2016/01/22 23:41:56
We should add a separate error for these (invalid
Evan Stade
2016/01/23 02:28:37
Done.
|