summaryrefslogtreecommitdiffstats
path: root/connectivity
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-12-21 13:00:33 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-12-21 16:09:31 +0100
commita3c838986e58896a925f381c198d3bf592f874a7 (patch)
treec14298bd187f51acfb66154ce16468ccbe7496a4 /connectivity
parenttdf#122020 crash in SvTreeList::InvalidateEntry (diff)
downloadcore-a3c838986e58896a925f381c198d3bf592f874a7.tar.gz
core-a3c838986e58896a925f381c198d3bf592f874a7.zip
tdf#120576 avoid crash during database migration
0xFFFF cast to short turned into -1 so wasn't seen as > 8000 Change-Id: I57592020c3c31751bec43f2619bf65d41ac47e87 Reviewed-on: https://gerrit.libreoffice.org/65539 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/PreparedStatement.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index e0d120d0cfec..648f3f678ff4 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -208,7 +208,7 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 nParameterIndex,
{
str = str.copy(0, max_varchar_len);
}
- const short nLength = str.getLength();
+ const auto nLength = str.getLength();
memcpy(pVar->sqldata, &nLength, 2);
// Actual data
memcpy(pVar->sqldata + 2, str.getStr(), str.getLength());
@@ -847,7 +847,7 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 nParameterIndex,
{
xBytesCopy.realloc( nMaxSize );
}
- const short nSize = xBytesCopy.getLength();
+ const auto nSize = xBytesCopy.getLength();
// 8000 corresponds to value from lcl_addDefaultParameters
// in dbaccess/source/filter/hsqldb/createparser.cxx
if (nSize > 8000)