summaryrefslogtreecommitdiff
path: root/comphelper/source
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 /comphelper/source
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 'comphelper/source')
-rw-r--r--comphelper/source/property/propagg.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/comphelper/source/property/propagg.cxx b/comphelper/source/property/propagg.cxx
index 0d8ea6a10bb9..5a0574460cf4 100644
--- a/comphelper/source/property/propagg.cxx
+++ b/comphelper/source/property/propagg.cxx
@@ -589,6 +589,9 @@ void SAL_CALL OPropertySetAggregationHelper::setPropertyValues(
OPropertySetHelper::setPropertyValues(_rPropertyNames, _rValues);
else if (_rPropertyNames.getLength() == 1) // use the more efficient way
{
+ if (_rValues.getLength() != 1)
+ throw IllegalArgumentException("lengths do not match", static_cast<XPropertySet*>(this),
+ -1);
try
{
setPropertyValue( _rPropertyNames[0], _rValues[0] );
@@ -631,6 +634,9 @@ void SAL_CALL OPropertySetAggregationHelper::setPropertyValues(
// mixed
else
{
+ if (_rValues.getLength() != nLen)
+ throw IllegalArgumentException("lengths do not match",
+ static_cast<XPropertySet*>(this), -1);
const css::uno::Any* pValues = _rValues.getConstArray();
// dividing the Names and _rValues