diff options
-rw-r--r-- | connectivity/source/drivers/firebird/PreparedStatement.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index 7c7b3d3e769d..1be05f7c507a 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -208,10 +208,11 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 nParameterIndex, switch (dtype) { case SQL_VARYING: { + const sal_Int32 max_varchar_len = 0xFFFF; // First 2 bytes indicate string size - if (str.getLength() > (2^16)-1) + if (str.getLength() > max_varchar_len) { - str = str.copy(0, (2^16)-1); + str = str.copy(0, max_varchar_len); } const short nLength = str.getLength(); memcpy(pVar->sqldata, &nLength, 2); |