summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-26 09:23:48 +0100
committerAndras Timar <andras.timar@collabora.com>2018-04-07 17:45:26 +0200
commit25e02d8389c5e9f06b5459c348a7e5a125a9c884 (patch)
tree40c141de3a85de9df86c40ee7125db46cd1f9849
parentdb6c2112c230d1b270a00bc817273a39b1b86f32 (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> (cherry picked from commit e82beb0812f2f4742b80ba1f63a026cbe77f5b25)
-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 156afa94e687..3bf6a9b0925c 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -3080,6 +3080,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)
{