diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2018-01-02 22:55:45 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2018-01-04 07:49:37 +0100 |
commit | 1bbadad79d91005dc18a3c1e34de14d02660f6ab (patch) | |
tree | 3091def724f0adbc4b8e483dbea9b7e1000738c4 /connectivity | |
parent | d1296f4e02631c06e374a391a6dc12dc35d599e4 (diff) |
firebird-sdbc: check parameter index before setting in all cases
Change-Id: I291b0436a7cfde07879436a753329b52ff0c1049
Reviewed-on: https://gerrit.libreoffice.org/47284
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/firebird/PreparedStatement.cxx | 28 |
1 files changed, 16 insertions, 12 deletions
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); } |