diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2014-01-30 06:07:56 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2014-01-30 06:13:44 +0100 |
commit | 5e951de92544bceb19e03244f4ffef19c62c4d90 (patch) | |
tree | bcab71bc7527ae1e77fefe9be6acdc9a6912fb76 | |
parent | c634faf12886228754eb59ec9bedf6cd6f631054 (diff) |
fdo#74160 firebird XParameters::setString truncate to 65535 characters
as opposed to 17 characters
Change-Id: I65c82243946c22eee0f033977b1cd0c5a84d226b
-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); |