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

ofz avoid oom

Change-Id: I7d7e249a75fb33ac6a72e941f6b8f92ff8edf25a
üst 4e63ff0d
......@@ -1048,8 +1048,13 @@ bool PlfKme::Read(SvStream &rS)
nOffSet = rS.Tell();
Tcg255SubStruct::Read( rS );
rS.ReadInt32( iMac );
if ( iMac )
if (iMac > 0)
{
//each Kme is 14 bytes in size
size_t nMaxAvailableRecords = rS.remainingSize() / 14;
if (static_cast<sal_uInt32>(iMac) > nMaxAvailableRecords)
return false;
rgkme.reset( new Kme[ iMac ] );
for( sal_Int32 index=0; index<iMac; ++index )
{
......
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