From a719865c9af0c38c429a00e9185575644e430666 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 9 Dec 2014 13:36:09 +0000 Subject: coverity#1242895 Untrusted loop bound Change-Id: I057f81785972106b10c8c5a7992b2b1ec1dc145e --- sc/source/filter/starcalc/scflt.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sc') diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx index f1331631ca76..870a68f527f6 100644 --- a/sc/source/filter/starcalc/scflt.cxx +++ b/sc/source/filter/starcalc/scflt.cxx @@ -1460,8 +1460,10 @@ void Sc10Import::LoadTables() for (i=0; i < DataCount; i++) { rStream.ReadUInt16( DataEnd ); + DataEnd = SanitizeCol(DataEnd); rStream.ReadUInt16( DataValue ); - for (SCCOL j = static_cast(DataStart); j <= static_cast(DataEnd); j++) pDoc->SetColWidth(j, static_cast (TabNo), DataValue); + for (SCCOL j = static_cast(DataStart); j <= static_cast(DataEnd); j++) + pDoc->SetColWidth(j, static_cast (TabNo), DataValue); DataStart = DataEnd + 1; } pPrgrsBar->Progress(); -- cgit