ofz#47639 avoid Integer-overflow

Change-Id: I3f89238187dfb8cfd7a929d5f5576b83f6ec37c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134982
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara 2022-05-26 09:19:38 +01:00
parent 24c709655e
commit f26926fe67

View file

@ -40,6 +40,7 @@ static std::size_t ParseMathMLUnsignedNumber(std::u16string_view rStr, Fraction&
if (validNomDen
&& (o3tl::checked_multiply(nom, sal_Int64(10), nom)
|| o3tl::checked_add(nom, sal_Int64(cD - u'0'), nom)
|| nom >= std::numeric_limits<sal_Int32>::max()
|| (nDecimalPoint != std::u16string_view::npos
&& o3tl::checked_multiply(den, sal_Int64(10), den))))
{