From 44cef0d785c21f97e9f2b4f089491957301b8063 Mon Sep 17 00:00:00 2001 From: Tamas Bunth Date: Thu, 6 Sep 2018 16:58:42 +0200 Subject: mysqlc: ensure cursor is not out of range MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit when calling getXXX() methods of a simple result set. Change-Id: I9e018385bb73468ea520b03275232c0982cbcba0 Reviewed-on: https://gerrit.libreoffice.org/60095 Tested-by: Jenkins Reviewed-by: Tamás Bunth --- connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx') diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx b/connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx index 9bfd8ecc1aef..7bf7912220ba 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx @@ -71,8 +71,10 @@ class OResultSet final : public OBase_Mutex, MYSQL_RES* m_pResult; unsigned int fieldCount; rtl_TextEncoding m_encoding; - sal_Int32 m_nCurrentField = 0; bool m_bWasNull = false; // did the last getXXX result null? + sal_Int32 m_nRowPosition = 0; + sal_Int32 m_nRowCount = 0; + // OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* createArrayHelper() const SAL_OVERRIDE; // OPropertySetHelper @@ -232,9 +234,8 @@ public: css::uno::Sequence SAL_CALL deleteRows(const css::uno::Sequence& rows) SAL_OVERRIDE; - /// @throws SQLException - /// @throws RuntimeException void checkColumnIndex(sal_Int32 index); + void checkRowIndex(); private: using ::cppu::OPropertySetHelper::getFastPropertyValue; -- cgit v1.2.3