diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2021-01-20 12:21:43 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-22 08:03:16 +0100 |
commit | 3032cf9df042f50511a15c6a627c50f708a34238 (patch) | |
tree | 87f3299e85435bc78315b941e242f5439161977f | |
parent | 3adff41ab14ab27ca07cffef0f38471ac5321ee2 (diff) |
tdf#139782 sc: Don't try to access unallocated column
This fixes a regression from
commit 7282014e362a1529a36c88eb308df8ed359c2cfa
Date: Fri Feb 1 15:15:16 2019 +0100
tdf#50916 Makes numbers of columns dynamic.
Change-Id: I12a780bf52024cef31188651813d3a93cc2b5ddd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109704
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sc/source/core/data/dociter.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index d4e565edf80e8..686e426c8d526 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -1798,6 +1798,10 @@ bool ScQueryCellIterator::BinarySearch() assert(nTab < rDoc.GetTableCount() && "index out of bounds, FIX IT"); nCol = maParam.nCol1; + + if (nCol >= rDoc.maTabs[nTab]->GetAllocatedColumnsCount()) + return false; + ScColumn* pCol = &(rDoc.maTabs[nTab])->aCol[nCol]; if (pCol->IsEmptyData()) return false; |