Perform some sanity checks on nsMozIconURI.

This commit is contained in:
Pale Moon
2018-07-01 16:35:31 +02:00
committed by Roy Tam
parent 18c6558ac0
commit 672b7a5dee
+10
View File
@@ -637,7 +637,17 @@ nsMozIconURI::Deserialize(const URIParams& aParams)
mContentType = params.contentType();
mFileName = params.fileName();
mStockIcon = params.stockIcon();
if (params.iconSize() < -1 ||
params.iconSize() >= (int32_t) ArrayLength(kSizeStrings)) {
return false;
}
mIconSize = params.iconSize();
if (params.iconState() < -1 ||
params.iconState() >= (int32_t) ArrayLength(kStateStrings)) {
return false;
}
mIconState = params.iconState();
return true;