From b08370dc44d739a0b0b011b506f9aeed0998d8d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 7 Feb 2022 12:20:04 +0000 Subject: [PATCH] fix s390x hsql to firebird migration --- ...ig-endian-hsql-to-firebird-migration.patch | 44 +++++++++++++++++++ libreoffice.spec | 4 +- 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 0001-fix-big-endian-hsql-to-firebird-migration.patch diff --git a/0001-fix-big-endian-hsql-to-firebird-migration.patch b/0001-fix-big-endian-hsql-to-firebird-migration.patch new file mode 100644 index 0000000..b9f1050 --- /dev/null +++ b/0001-fix-big-endian-hsql-to-firebird-migration.patch @@ -0,0 +1,44 @@ +From 099a72eb674ca25e348747229a188da5d00a58e1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 7 Feb 2022 12:17:03 +0000 +Subject: [PATCH] fix big-endian hsql to firebird migration + +Change-Id: I047d2366ad80eca701924cb0f66b6b1bcfdcac5b +--- + connectivity/source/drivers/firebird/PreparedStatement.cxx | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx +index 9225c3b26895..39fef04a185c 100644 +--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx ++++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx +@@ -207,7 +207,8 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 nParameterIndex, + { + str = str.copy(0, max_varchar_len); + } +- const auto nLength = str.getLength(); ++ const sal_uInt16 nLength = str.getLength(); ++ static_assert(sizeof(nLength) == 2, "must match dest memcpy len"); + memcpy(pVar->sqldata, &nLength, 2); + // Actual data + memcpy(pVar->sqldata + 2, str.getStr(), str.getLength()); +@@ -908,7 +909,7 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 nParameterIndex, + { + xBytesCopy.realloc( nMaxSize ); + } +- const auto nSize = xBytesCopy.getLength(); ++ const sal_uInt16 nSize = xBytesCopy.getLength(); + // 8000 corresponds to value from lcl_addDefaultParameters + // in dbaccess/source/filter/hsqldb/createparser.cxx + if (nSize > 8000) +@@ -916,6 +917,7 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 nParameterIndex, + free(pVar->sqldata); + pVar->sqldata = static_cast(malloc(sizeof(char) * nSize + 2)); + } ++ static_assert(sizeof(nSize) == 2, "must match dest memcpy len"); + // First 2 bytes indicate string size + memcpy(pVar->sqldata, &nSize, 2); + // Actual data +-- +2.33.1 + diff --git a/libreoffice.spec b/libreoffice.spec index b48bbec..24fd368 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -249,8 +249,9 @@ Patch4: 0001-the-real-font-used-for-Roman-is-arbitrary.patch Patch5: 0001-fix-direct-leaks-in-vcl-cppunit-tests.patch Patch6: 0001-this-test-assumes-KacstBook-has-no-Latin-glyphs.patch Patch7: 0001-Avoid-calling-AVX-code-in-library-static-initializat.patch +Patch8: 0001-fix-big-endian-hsql-to-firebird-migration.patch # see if ICE still happens -Patch8: 0001-disable-ICEing-function-under-x86.patch +Patch9: 0001-disable-ICEing-function-under-x86.patch # not upstreamed Patch500: 0001-disable-libe-book-support.patch @@ -969,7 +970,6 @@ sed -i -e s/CppunitTest_dbaccess_RowSetClones// dbaccess/Module_dbaccess.mk # pp sed -i -e /CppunitTest_xmlsecurity_signing/d xmlsecurity/Module_xmlsecurity.mk sed -i -e /CppunitTest_xmlsecurity_pdfsigning/d xmlsecurity/Module_xmlsecurity.mk %ifarch s390x -sed -i -e /CppunitTest_dbaccess_hsqlbinary_import/d dbaccess/Module_dbaccess.mk sed -i -e /CppunitTest_vcl_svm_test/d vcl/Module_vcl.mk %endif