Kaydet (Commit) cd5a4971 authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#4578 Integer-overflow

Change-Id: I2fcd530b3217c72385301b8f3456557c8c8cec13
Reviewed-on: https://gerrit.libreoffice.org/46183Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 6ff9b5a6
......@@ -62,8 +62,12 @@ sal_Int32 ParseMathMLUnsignedNumber(const OUString &rStr, Fraction *pUN)
assert(nDecimalPoint < nIdx);
*pUN = Fraction(rStr.copy(0, nDecimalPoint).toInt32(), 1);
if (++nDecimalPoint < nIdx)
*pUN += Fraction(rStr.copy(nDecimalPoint, nIdx-nDecimalPoint).toInt32(),
lcl_GetPowerOf10(nIdx-nDecimalPoint));
{
const sal_Int32 nDigits = nIdx - nDecimalPoint;
if (nDigits > 9)
return -1;
*pUN += Fraction(rStr.copy(nDecimalPoint, nDigits).toInt32(), lcl_GetPowerOf10(nDigits));
}
return nIdx;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment