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

coverity#1266496 Untrusted loop bound

Change-Id: Ibab7f84940f6eec75bc3ee914bac59a07689a80c
üst 2987f8d8
...@@ -1266,6 +1266,15 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic ) ...@@ -1266,6 +1266,15 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
pTIFF->ReadUInt16( nNumTags ); pTIFF->ReadUInt16( nNumTags );
nPos = pTIFF->Tell(); nPos = pTIFF->Tell();
const size_t nMinRecordSize = 8;
const size_t nMaxRecords = pTIFF->remainingSize() / nMinRecordSize;
if (nNumTags > nMaxRecords)
{
SAL_WARN("filter.tiff", "Parsing error: " << nMaxRecords <<
" max possible entries, but " << nNumTags << " claimed, truncating");
nNumTags = nMaxRecords;
}
// Schleife ueber Tags: // Schleife ueber Tags:
for( i = 0; i < nNumTags; i++ ) for( i = 0; i < nNumTags; 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