[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - connectivity/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Sep 14 11:07:01 UTC 2018
connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit 0184d388e175b2df79e2a9ba48ce28552915f75f
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
AuthorDate: Wed Sep 12 17:39:07 2018 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Sep 14 13:06:34 2018 +0200
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 at gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/60461
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
index cc8d3bbdfad5..b59afae53687 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
@@ -260,6 +260,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;
@@ -1082,6 +1083,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 ? */
More information about the Libreoffice-commits
mailing list