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

coverity#1242628 Untrusted loop bound

Change-Id: Ifabdfab76279e4417642ce10cb86a43184b94629
üst 5aa174b0
......@@ -838,6 +838,16 @@ XclImpCachedMatrix::XclImpCachedMatrix( XclImpStream& rStrm ) :
++mnScRows;
}
//assuming worse case scenario of unknown types
const size_t nMinRecordSize = 1;
const size_t nMaxRows = rStrm.GetRecLeft() / (nMinRecordSize * mnScCols);
if (mnScRows > nMaxRows)
{
SAL_WARN("sc", "Parsing error: " << nMaxRows <<
" max possible rows, but " << mnScRows << " claimed, truncating");
mnScRows = nMaxRows;
}
for( SCSIZE nScRow = 0; nScRow < mnScRows; ++nScRow )
for( SCSIZE nScCol = 0; nScCol < mnScCols; ++nScCol )
maValueList.push_back( new XclImpCachedValue( rStrm ) );
......
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