From 2c3ee5c72d40f9415b52cb0851dd328c254124f6 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 9 Nov 2010 16:43:41 +0100 Subject: vcl117: #i115493# check index for validity --- cui/source/options/optcolor.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cui') diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index ff10e2744533..bcc4dbf54dcb 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -945,12 +945,14 @@ ColorConfigWindow_Impl::ColorConfigWindow_Impl(Window* pParent, const ResId& rRe aColorBoxes[0]->SetHelpId( aColorLBHids[0] ); + OSL_ENSURE( nCount < sal_Int32(sizeof(aColorLBHids)/sizeof(aColorLBHids[0])), "too few helpIDs for color listboxes" ); for( sal_Int32 i = 1; i < nCount; i++ ) { if(aColorBoxes[i]) { aColorBoxes[i]->CopyEntries( *aColorBoxes[0] ); - aColorBoxes[i]->SetHelpId( aColorLBHids[i] ); + if( i < sal_Int32(sizeof(aColorLBHids)/sizeof(aColorLBHids[0])) ) + aColorBoxes[i]->SetHelpId( aColorLBHids[i] ); } } } -- cgit