Bug 1484910 - Use the CheckedInt API correctly; r=masayuki

Differential Revision: https://phabricator.services.mozilla.com/D21235

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alex Gaynor 2019-03-07 05:49:44 +00:00
parent be4b24fd5d
commit 34c7c8f3d5

View File

@ -1037,7 +1037,8 @@ class WidgetQueryContentEvent : public WidgetGUIEvent {
return true;
}
// Otherwise, we don't allow too large offset.
CheckedInt<uint32_t> absOffset = mOffset + aInsertionPointOffset;
CheckedInt<uint32_t> absOffset =
CheckedInt<uint32_t>(mOffset) + aInsertionPointOffset;
if (NS_WARN_IF(!absOffset.isValid())) {
mOffset = UINT32_MAX;
return false;