diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-09-26 20:01:20 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-09-26 20:05:00 +0200 |
commit | 70412d0f3f7979d3d069be8121d49dbb96775cce (patch) | |
tree | 53532dd95fa4d50c6b95b1a5983ba19c11e937e1 /sc | |
parent | 83fc0c59037fa743c3ebc58e784eef3d120ffc2e (diff) |
don't access out of bound array index, fdo#55022
Change-Id: Ica088822055b2fb5bbd6dabe6482b7cb6c472c48
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 d6d59cedcc2d..2d8808e4b0cb 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -565,7 +565,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 ) { |