diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-12-05 21:45:48 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-12-06 05:32:37 +0000 |
commit | b15eb164a8e44c02c196cef9f3de5e5478eb78de (patch) | |
tree | 549922673e2594c385ddaabe0fb379a8ff0e020c /cppuhelper | |
parent | d3f9b3029a1b5f6b389978509fdf8de7e128a4b3 (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 'cppuhelper')
-rw-r--r-- | cppuhelper/source/propshlp.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx index 3af4cda49bb7..18ee9d1bb770 100644 --- a/cppuhelper/source/propshlp.cxx +++ b/cppuhelper/source/propshlp.cxx @@ -25,6 +25,7 @@ #include <cppuhelper/exc_hlp.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/lang/DisposedException.hpp> +#include <com/sun/star/lang/IllegalArgumentException.hpp> #include <memory> #include <sal/log.hxx> @@ -867,6 +868,9 @@ void OPropertySetHelper::setPropertyValues( const Sequence<Any>& rValues ) { sal_Int32 nSeqLen = rPropertyNames.getLength(); + if (nSeqLen != rValues.getLength()) + throw IllegalArgumentException("lengths do not match", static_cast<XPropertySet*>(this), + -1); std::unique_ptr<sal_Int32[]> pHandles(new sal_Int32[ nSeqLen ]); // get the map table IPropertyArrayHelper & rPH = getInfoHelper(); |