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

ofz#5561 Integer-overflow

Change-Id: I57660848190efff8e6354670eb68b60ed57f0094
Reviewed-on: https://gerrit.libreoffice.org/48308Tested-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 4b65de81
......@@ -1464,7 +1464,17 @@ WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const
{
bIsUnicode = m_pWw8Fib->m_fExtChar;
}
sal_Int32 nLen = (nCpEnd - nCpStart) * (bIsUnicode ? 2 : 1);
sal_Int32 nLen = nCpEnd - nCpStart;
if (bIsUnicode)
{
bool bFail = o3tl::checked_multiply<WW8_CP>(nLen, 2, nLen);
if (bFail)
{
SAL_WARN("sw.ww8", "broken offset, ignoring");
return WW8_CP_MAX;
}
}
/*
If this cp is inside this piece, or it's the last piece and we are
......
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