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

ofz#7366 Integer overflow

Change-Id: Ia81f6681dd846715b75c87dd9ddc8520a2e9ed5a
Reviewed-on: https://gerrit.libreoffice.org/52403Tested-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 c110c93a
......@@ -2037,10 +2037,16 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
sal_uInt16 nLen=nOrderLen;
auto nWidth = ReadCoord(bCoord32);
auto nHeight = ReadCoord(bCoord32);
if (nWidth < 0 || nHeight < 0)
if (nWidth < 0 || nHeight < 0 ||
nWidth > std::numeric_limits<decltype(nWidth)>::max() ||
nHeight > std::numeric_limits<decltype(nHeight)>::max())
{
aAttr.aChrCellSize = aDefAttr.aChrCellSize;
}
else
{
aAttr.aChrCellSize = Size(nWidth, nHeight);
}
if (bCoord32) nLen-=8; else nLen-=4;
if (nLen>=4) {
pOS2MET->SeekRel(4); nLen-=4;
......
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