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

ofz#4995 Integer-overflow

Change-Id: Iad6e1c90cb099077809cc5684f683a0ba25b303b
Reviewed-on: https://gerrit.libreoffice.org/47519Tested-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 7df57f69
......@@ -51,17 +51,19 @@ void BigInt::MakeBigInt( const BigInt& rVal )
}
else
{
sal_Int32 nTmp = rVal.nVal;
nVal = rVal.nVal;
bIsBig = true;
if ( nTmp < 0 )
sal_uInt32 nTmp;
if (nVal < 0)
{
bIsNeg = true;
nTmp = -nTmp;
nTmp = -static_cast<sal_Int64>(nVal);
}
else
{
bIsNeg = false;
nTmp = nVal;
}
nNum[0] = (sal_uInt16)(nTmp & 0xffffL);
nNum[1] = (sal_uInt16)(nTmp >> 16);
......
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