summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-26 09:23:48 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-06-01 14:26:46 +0200
commitae20434a0f186df2f4a6e6def1b6d1953ac2df27 (patch)
tree812af32e5a5e916ffd32fe1458d208c9f4c803a7
parent5266c44a7a9d2288405baf9dc34b27f00d636ec8 (diff)
forcepoint #30 check validity of group range
Change-Id: Ie0611f36809b051ce46030e44c137b4e1f8d2fe0 Reviewed-on: https://gerrit.libreoffice.org/51865 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
-rwxr-xr-xsc/qa/unit/data/xls/fail/forcepoint-group-range-1.xlsbin0 -> 163886 bytes
-rw-r--r--sc/source/core/data/column3.cxx2
2 files changed, 2 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/fail/forcepoint-group-range-1.xls b/sc/qa/unit/data/xls/fail/forcepoint-group-range-1.xls
new file mode 100755
index 000000000000..1aca9c7f113e
--- /dev/null
+++ b/sc/qa/unit/data/xls/fail/forcepoint-group-range-1.xls
Binary files differ
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 27abbbf249fe..47a69052d660 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -3000,6 +3000,8 @@ public:
xPrevGrp->mnLength += xCurGrp->mnLength;
pCur->SetCellGroup(xPrevGrp);
sc::formula_block::iterator itGrpEnd = it;
+ if (xCurGrp->mnLength > std::distance(itGrpEnd, itEnd))
+ throw css::lang::IllegalArgumentException();
std::advance(itGrpEnd, xCurGrp->mnLength);
for (++it; it != itGrpEnd; ++it)
{