diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-09 13:36:09 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-12-09 14:13:26 +0000 |
commit | a719865c9af0c38c429a00e9185575644e430666 (patch) | |
tree | ca417922c7b1c96a3b3f74cf0bb01e5a204dda5e /sc | |
parent | b5fc1a479080ef3f17237bee99b5596767a2e438 (diff) |
coverity#1242895 Untrusted loop bound
Change-Id: I057f81785972106b10c8c5a7992b2b1ec1dc145e
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/starcalc/scflt.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
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<SCCOL>(DataStart); j <= static_cast<SCCOL>(DataEnd); j++) pDoc->SetColWidth(j, static_cast<SCTAB> (TabNo), DataValue); + for (SCCOL j = static_cast<SCCOL>(DataStart); j <= static_cast<SCCOL>(DataEnd); j++) + pDoc->SetColWidth(j, static_cast<SCTAB> (TabNo), DataValue); DataStart = DataEnd + 1; } pPrgrsBar->Progress(); |