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

coverity#1242810 Untrusted loop bound

Change-Id: I457f0f92dc32630e52efbb2bd068208a8570c5d0
üst 357f9d22
......@@ -1487,6 +1487,16 @@ SvStream &SfxItemSet::Load
// Load Item count and as many Items
sal_uInt16 nCount = 0;
rStream.ReadUInt16( nCount );
const size_t nMinRecordSize = sizeof(sal_uInt16) * 2;
const size_t nMaxRecords = rStream.remainingSize() / nMinRecordSize;
if (nCount > nMaxRecords)
{
SAL_WARN("svl", "Parsing error: " << nMaxRecords <<
" max possible entries, but " << nCount << " claimed, truncating");
nCount = nMaxRecords;
}
for ( sal_uInt16 i = 0; i < nCount; ++i )
{
// Load Surrogate/Item and resolve Surrogate
......
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