diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-09-26 20:01:20 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-09-27 10:05:15 +0100 |
commit | 541fbcd2fae54a7b8bce25873d4d1b4891c1c796 (patch) | |
tree | 2661999d242d247bfba0e0543fdd9391917a7658 /sc | |
parent | 47014647eced4864e149b923b7eb024418e71782 (diff) |
don't access out of bound array index, fdo#55022
Change-Id: Ica088822055b2fb5bbd6dabe6482b7cb6c472c48
Signed-off-by: Michael Meeks <michael.meeks@suse.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/dociter.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index 92c7cbd2bfef..187a327206ae 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -568,7 +568,11 @@ bool ScDBQueryDataIterator::DataAccessInternal::getCurrent(Value& rValue) SCROW nThisRow = ScDBQueryDataIterator::GetRowByColEntryIndex(*mpDoc, nTab, nCol, nColRow); while ( (nColRow < nCellCount) && (nThisRow < nRow) ) - nThisRow = ScDBQueryDataIterator::GetRowByColEntryIndex(*mpDoc, nTab, nCol, ++nColRow); + { + ++nColRow; + if(nColRow < nCellCount) + nThisRow = ScDBQueryDataIterator::GetRowByColEntryIndex(*mpDoc, nTab, nCol, nColRow); + } if ( nColRow < nCellCount && nThisRow <= mpParam->nRow2 ) { |