[Libreoffice-commits] core.git: connectivity/source

Lionel Elie Mamane lionel at mamane.lu
Thu Jan 4 06:50:04 UTC 2018


 connectivity/source/drivers/firebird/PreparedStatement.cxx |   28 +++++++------
 1 file changed, 16 insertions(+), 12 deletions(-)

New commits:
commit 1bbadad79d91005dc18a3c1e34de14d02660f6ab
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Tue Jan 2 22:55:45 2018 +0100

    firebird-sdbc: check parameter index before setting in all cases
    
    Change-Id: I291b0436a7cfde07879436a753329b52ff0c1049
    Reviewed-on: https://gerrit.libreoffice.org/47284
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>

diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index f951537fde28..8b00beb20626 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -348,6 +348,7 @@ void SAL_CALL OPreparedStatement::setNull(sal_Int32 nIndex, sal_Int32 /*nSqlType
     checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
     ensurePrepared();
 
+    checkParameterIndex(nIndex);
     setParameterNull(nIndex);
 }
 
@@ -584,6 +585,7 @@ void OPreparedStatement::setClob( sal_Int32 nParameterIndex, const OUString& rSt
 {
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
+    checkParameterIndex(nParameterIndex);
 
 #if SAL_TYPES_SIZEOFPOINTER == 8
     isc_blob_handle aBlobHandle = 0;
@@ -622,6 +624,7 @@ void SAL_CALL OPreparedStatement::setBlob(sal_Int32 nParameterIndex,
 {
     ::osl::MutexGuard aGuard(m_aMutex);
     checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
+    checkParameterIndex(nParameterIndex);
 
 #if SAL_TYPES_SIZEOFPOINTER == 8
     isc_blob_handle aBlobHandle = 0;
@@ -668,19 +671,19 @@ void SAL_CALL OPreparedStatement::setBlob(sal_Int32 nParameterIndex,
 }
 
 
-void SAL_CALL OPreparedStatement::setArray( sal_Int32, const Reference< XArray >& )
+void SAL_CALL OPreparedStatement::setArray( sal_Int32 nIndex, const Reference< XArray >& )
 {
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
-
+    checkParameterIndex(nIndex);
 }
 
 
-void SAL_CALL OPreparedStatement::setRef( sal_Int32, const Reference< XRef >& )
+void SAL_CALL OPreparedStatement::setRef( sal_Int32 nIndex, const Reference< XRef >& )
 {
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
-
+    checkParameterIndex(nIndex);
 }
 
 
@@ -762,19 +765,19 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, c
 }
 
 
-void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32, sal_Int32, const ::rtl::OUString& )
+void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 nIndex, sal_Int32, const ::rtl::OUString& )
 {
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
-
+    checkParameterIndex(nIndex);
 }
 
 
-void SAL_CALL OPreparedStatement::setObject( sal_Int32, const Any& )
+void SAL_CALL OPreparedStatement::setObject( sal_Int32 nIndex, const Any& )
 {
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
-
+    checkParameterIndex(nIndex);
 }
 
 void SAL_CALL OPreparedStatement::setBytes(sal_Int32 nParameterIndex,
@@ -782,6 +785,7 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 nParameterIndex,
 {
     ::osl::MutexGuard aGuard(m_aMutex);
     checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
+    checkParameterIndex(nParameterIndex);
 
 #if SAL_TYPES_SIZEOFPOINTER == 8
     isc_blob_handle aBlobHandle = 0;
@@ -825,19 +829,19 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 nParameterIndex,
 }
 
 
-void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32, const Reference< css::io::XInputStream >&, sal_Int32 )
+void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 nIndex, const Reference< css::io::XInputStream >&, sal_Int32 )
 {
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
-
+    checkParameterIndex(nIndex);
 }
 
 
-void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32, const Reference< css::io::XInputStream >&, sal_Int32 )
+void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 nIndex, const Reference< css::io::XInputStream >&, sal_Int32 )
 {
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
-
+    checkParameterIndex(nIndex);
 }
 
 


More information about the Libreoffice-commits mailing list