Perform some sanity checks on nsMozIconURI.

This commit is contained in:
Pale Moon 2018-05-05 12:20:42 +02:00 • committed by Roy Tam
commit 1b173ad9e4

View file

@ -688,7 +688,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;