diff options
Diffstat (limited to 'sc/source/filter/excel')
-rw-r--r-- | sc/source/filter/excel/excform.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx index eda413421f82..630997a7d06f 100644 --- a/sc/source/filter/excel/excform.cxx +++ b/sc/source/filter/excel/excform.cxx @@ -1791,6 +1791,16 @@ void ExcelToSc::ReadExtensionArray( unsigned int n, XclImpStream& aIn ) OSL_FAIL( "ExcelToSc::ReadExtensionArray - missing matrix" ); } + //assuming worse case scenario of unknown types + const size_t nMinRecordSize = 1; + const size_t nMaxRows = aIn.GetRecLeft() / (nMinRecordSize * nCols); + if (nRows > nMaxRows) + { + SAL_WARN("sc", "Parsing error: " << nMaxRows << + " max possible rows, but " << nRows << " claimed, truncating"); + nRows = nMaxRows; + } + svl::SharedStringPool& rPool = GetDoc().GetSharedStringPool(); for( nR = 0 ; nR < nRows; nR++ ) { |