summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorJavier Fernandez <jfernandez@igalia.com>2013-06-06 09:14:49 +0000
committerLionel Elie Mamane <lionel@mamane.lu>2013-06-06 14:58:57 +0000
commitb6a91e6d30e2a15880638d570d4c7d1e6c4a1853 (patch)
tree4184d869e1bb6e33ab9bb13635a766cfc90c2bb7 /dbaccess
parent248a63f5d0d09b6e8388192a0fe7332a624e8829 (diff)
Prevent out-of-range values coming from ListBox GetSelectEntryPos.
Change-Id: Ia787c412408ef53db3c8458f54c7843c669c81ad Reviewed-on: https://gerrit.libreoffice.org/4174 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Tested-by: Lionel Elie Mamane <lionel@mamane.lu>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/dlg/generalpage.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 3eea60ae223c..037391641dfd 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -329,6 +329,11 @@ namespace dbaui
{
// get the type from the entry data
sal_Int16 nSelected = _pBox->GetSelectEntryPos();
+ if (nSelected < 0 || nSelected >= m_aURLPrefixes.size() )
+ {
+ SAL_WARN("dbaui.OGeneralPage", "Got out-of-range value '" << nSelected << "' from the DatasourceType selection ListBox's GetSelectEntryPos(): " << ((nSelected < 0) ? "negative" : "no corresponding URL prefix") );
+ return 0L;
+ }
const OUString sURLPrefix = m_aURLPrefixes[ nSelected ];
setParentTitle( sURLPrefix );