diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-26 09:23:48 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-04-05 16:22:11 +0200 |
commit | e82beb0812f2f4742b80ba1f63a026cbe77f5b25 (patch) | |
tree | 0c69c36d5f793560b710f78ff9111dca21ea068d | |
parent | a471620af5099c960e22b46fad6e6f92a5055dbd (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-x | sc/qa/unit/data/xls/fail/forcepoint-group-range-1.xls | bin | 0 -> 163886 bytes | |||
-rw-r--r-- | sc/source/core/data/column3.cxx | 2 |
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 Binary files differnew file mode 100755 index 000000000000..1aca9c7f113e --- /dev/null +++ b/sc/qa/unit/data/xls/fail/forcepoint-group-range-1.xls diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 8e36534e8461..d3e3e24d88c5 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -3089,6 +3089,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) { |