summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-12-05 21:45:48 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-12-06 05:32:37 +0000
commitb15eb164a8e44c02c196cef9f3de5e5478eb78de (patch)
tree549922673e2594c385ddaabe0fb379a8ff0e020c /svx
parentd3f9b3029a1b5f6b389978509fdf8de7e128a4b3 (diff)
tdf#152380: add checks for names and values sequences length equality
Change-Id: Ibeef551126874bcfffb4e7736588e2e1873f5768 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143681 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/table/cell.cxx3
-rw-r--r--svx/source/unodraw/unoshape.cxx5
2 files changed, 7 insertions, 1 deletions
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index a358865334d9..5dbc1ee1a8e5 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -1282,6 +1282,9 @@ void SAL_CALL Cell::setPropertyValues( const Sequence< OUString >& aPropertyName
throw DisposedException();
const sal_Int32 nCount = aPropertyNames.getLength();
+ if (nCount != aValues.getLength())
+ throw css::lang::IllegalArgumentException("lengths do not match",
+ static_cast<cppu::OWeakObject*>(this), -1);
const OUString* pNames = aPropertyNames.getConstArray();
const Any* pValues = aValues.getConstArray();
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 0a26c6983ae7..60dd13aeac7d 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1679,8 +1679,11 @@ void SAL_CALL SvxShape::setPropertyValues( const css::uno::Sequence< OUString >&
::SolarMutexGuard aSolarGuard;
const sal_Int32 nCount = aPropertyNames.getLength();
- const OUString* pNames = aPropertyNames.getConstArray();
+ if (nCount != aValues.getLength())
+ throw css::lang::IllegalArgumentException("lengths do not match",
+ static_cast<cppu::OWeakObject*>(this), -1);
+ const OUString* pNames = aPropertyNames.getConstArray();
const uno::Any* pValues = aValues.getConstArray();
// make sure mbIsMultiPropertyCall and mpImpl->mpItemSet are