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

ofz#3820 Integer-overflow

Change-Id: I620b0278273e285100fe44d252389e6393a2022c
Reviewed-on: https://gerrit.libreoffice.org/43877Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst d97f0ceb
......@@ -97,10 +97,10 @@ static long ImplGetNumber(sal_uInt8* &rBuf, sal_uInt32& nSecurityCount)
nSecurityCount = 1; // error parsing the bounding box values
else if ( bValid )
{
const bool bFail = o3tl::checked_multiply(nRetValue, 10L, nRetValue);
const bool bFail = o3tl::checked_multiply<long>(nRetValue, 10, nRetValue) ||
o3tl::checked_add<long>(nRetValue, *rBuf - '0', nRetValue);
if (bFail)
return 0;
nRetValue += *rBuf - '0';
}
break;
}
......
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