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

coverity#1266494 Untrusted value as argument

Change-Id: I220e582cd75199b5619c2ad7607392b078ab3956
üst f159b942
...@@ -1201,7 +1201,15 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi ...@@ -1201,7 +1201,15 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
{ {
sal_Int16 i, nRowCount = 0; sal_Int16 i, nRowCount = 0;
rSt.ReadInt16( nRowCount ).ReadInt16( i ).ReadInt16( i ); rSt.ReadInt16( nRowCount ).ReadInt16( i ).ReadInt16( i );
if ( nRowCount ) const size_t nMinRecordSize = 4;
const size_t nMaxRecords = rSt.remainingSize() / nMinRecordSize;
if (nRowCount > 0 && static_cast<size_t>(nRowCount) > nMaxRecords)
{
SAL_WARN("filter.ms", "Parsing error: " << nMaxRecords <<
" max possible entries, but " << nRowCount << " claimed, truncating");
nRowCount = nMaxRecords;
}
if (nRowCount > 0)
{ {
sal_uInt32* pTableArry = new sal_uInt32[ nRowCount + 2 ]; sal_uInt32* pTableArry = new sal_uInt32[ nRowCount + 2 ];
pTableArry[ 0 ] = nTableProperties; pTableArry[ 0 ] = nTableProperties;
......
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