From b15eb164a8e44c02c196cef9f3de5e5478eb78de Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Mon, 5 Dec 2022 21:45:48 +0300 Subject: 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 --- forms/source/component/ListBox.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'forms') diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index 700bf6989304..79d6be399d6b 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -473,6 +473,10 @@ namespace frm ); if ( ( pSelectedItemsPos != _rPropertyNames.end() ) && aStringItemListExists ) { + if (_rPropertyNames.getLength() != _rValues.getLength()) + throw css::lang::IllegalArgumentException("lengths do not match", + static_cast(this), -1); + // both properties are present // -> remember the value for the select sequence pSelectSequenceValue = _rValues.getConstArray() + ( pSelectedItemsPos - _rPropertyNames.begin() ); -- cgit