[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - connectivity/source

Lionel Elie Mamane lionel at mamane.lu
Thu Jan 30 05:35:33 PST 2014


 connectivity/source/drivers/firebird/PreparedStatement.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 88eee0c3d591b210257298f3fd094727bd0dc05e
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Thu Jan 30 06:07:56 2014 +0100

    fdo#74160 firebird XParameters::setString truncate to 65535 characters
    
    as opposed to 17 characters
    
    Change-Id: I65c82243946c22eee0f033977b1cd0c5a84d226b
    Reviewed-on: https://gerrit.libreoffice.org/7745
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index 128f357..739f18a 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);


More information about the Libreoffice-commits mailing list