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

coverity#1242895 Untrusted loop bound

Change-Id: If01f0edecca8988087386507717ea8222058bab8
üst 886f962d
...@@ -1456,6 +1456,13 @@ void Sc10Import::LoadTables() ...@@ -1456,6 +1456,13 @@ void Sc10Import::LoadTables()
return; return;
} }
rStream.ReadUInt16( DataCount ); rStream.ReadUInt16( DataCount );
const sal_Size nMaxPossibleRecords = rStream.remainingSize() / (sizeof(sal_uInt16)*2);
if (DataCount > nMaxPossibleRecords)
{
SAL_WARN("sc", "Parsing error: " << nMaxPossibleRecords <<
" max possible pairs, but " << DataCount << " claimed, truncating");
DataCount = nMaxPossibleRecords;
}
DataStart = 0; DataStart = 0;
for (i=0; i < DataCount; i++) for (i=0; i < DataCount; i++)
{ {
......
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