summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2018-09-12 17:39:07 +0200
committerTamás Bunth <btomi96@gmail.com>2018-09-13 20:36:08 +0200
commit25ca37889ec99276afc9fb67ae4508efd77d18b9 (patch)
tree9f084dccda3ae1066a4433b8b8df0f603b6a305d /connectivity
parent658d3c9fabe7e66a1b8740cacf0f9b763d7ea130 (diff)
mysqlc: prep stmt: check if cursor out of range
Change-Id: I81307c6e45220081c39ddd7d1672457202bbc517 Reviewed-on: https://gerrit.libreoffice.org/60404 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
index e6e1a79c0728..1f55c2466cb6 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
@@ -259,6 +259,7 @@ sal_Int32 SAL_CALL OPreparedResultSet::getInt(sal_Int32 column)
{
MutexGuard aGuard(m_aMutex);
checkDisposed(OPreparedResultSet_BASE::rBHelper.bDisposed);
+ checkColumnIndex(column);
if (*m_aData[column - 1].is_null)
{
m_bWasNull = true;
@@ -1081,6 +1082,8 @@ css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL OPreparedResultSet::g
void OPreparedResultSet::checkColumnIndex(sal_Int32 index)
{
+ if (!m_aData)
+ throw SQLException("Cursor out of range", *this, rtl::OUString(), 1, Any());
if (index < 1 || index > static_cast<int>(m_nFieldCount))
{
/* static object for efficiency or thread safety is a problem ? */