summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-06-10 10:04:15 +0200
committerAndras Timar <andras.timar@collabora.com>2022-06-24 13:27:20 +0200
commit60613727b957715086c1d9bb688e4ce40e978b98 (patch)
treefa2e05068d0f3531a87b51fc17bebb5cbbfc769f /sc/source
parent72d518c67fe6d24295ab3bbaf7593bd26905598e (diff)
tdf#149503: Check size of vectors
Crash introduced by 41f95c4a35a6335e9edb2f51c11d136d88bd0749 "Remove SC_DPOUT_MAXLEVELS limit in Pivot" This brings back the old behaviour and now the "You cannot change this part of the pivot table." message is displayed again Change-Id: Ibad84c0a279d7d67b709b7e311ac875739cdb210 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135578 Tested-by: Eike Rathke <erack@redhat.com> Reviewed-by: Eike Rathke <erack@redhat.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135717 Tested-by: Jenkins
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/dpoutput.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index c15f9b6e848f..06081991050a 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -1331,6 +1331,8 @@ void ScDPOutput::GetPositionData(const ScAddress& rPos, DataPilotTablePositionDa
if (nField < 0)
break;
+ if (pColFields.size() < o3tl::make_unsigned(nField) + 1 )
+ break;
const uno::Sequence<sheet::MemberResult> rSequence = pColFields[nField].maResult;
if (!rSequence.hasElements())
break;
@@ -1360,6 +1362,8 @@ void ScDPOutput::GetPositionData(const ScAddress& rPos, DataPilotTablePositionDa
if (nField < 0)
break;
+ if (pRowFields.size() < o3tl::make_unsigned(nField) + 1 )
+ break;
const uno::Sequence<sheet::MemberResult> rSequence = pRowFields[nField].maResult;
if (!rSequence.hasElements())
break;