connectivity/source/parse/sqlflex.l |    6 ++++++
 sax/source/expatwrap/saxwriter.cxx  |   14 +++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)

New commits:
commit 15abdbe674d5eaadf6c1a273809466519f09b395
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Sep 18 13:18:16 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Sep 18 15:22:14 2025 +0200

    fix integer overflow in SaxWriterHelper (tdf#167205)
    
    found while investigating the bug mentioned, sadly does not fix it
    
    Change-Id: I669c50d718fcb219a854513aa0a0cb89dadbd435
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191119
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sax/source/expatwrap/saxwriter.cxx 
b/sax/source/expatwrap/saxwriter.cxx
index 75860f62550e..861a4ce76f2b 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -93,8 +93,8 @@ private:
     Sequence<sal_Int8> m_Sequence;
     sal_Int8* mp_Sequence;
 
-    sal_Int32 nLastLineFeedPos; // is negative after writing a sequence
-    sal_uInt32 nCurrentPos;
+    sal_Int64 nLastLineFeedPos; // is negative after writing a sequence
+    sal_uInt64 nCurrentPos;
     bool m_bStartElementFinished;
 
     std::vector<ReplacementPair> m_Replacements;
@@ -106,11 +106,11 @@ private:
     // so the sequence has to write out and reset rPos to 0
     // writes sequence only on overflow, sequence could be full on the end 
(rPos == SEQUENCESIZE)
     /// @throws SAXException
-    void AddBytes(sal_Int8* pTarget, sal_uInt32& rPos, const sal_Int8* pBytes,
+    void AddBytes(sal_Int8* pTarget, sal_uInt64& rPos, const sal_Int8* pBytes,
                   sal_uInt32 nBytesCount);
     /// @throws SAXException
     bool convertToXML(const sal_Unicode* pStr, sal_Int32 nStrLen, bool 
bDoNormalization,
-                      bool bNormalizeWhitespace, sal_Int8* pTarget, 
sal_uInt32& rPos);
+                      bool bNormalizeWhitespace, sal_Int8* pTarget, 
sal_uInt64& rPos);
     /// @throws SAXException
     void FinishStartElement();
 
@@ -145,7 +145,7 @@ public:
     bool writeString(const OUString& rWriteOutString, bool bDoNormalization,
                      bool bNormalizeWhitespace);
 
-    sal_uInt32 GetLastColumnCount() const noexcept
+    sal_uInt64 GetLastColumnCount() const noexcept
     {
         return static_cast<sal_uInt32>(nCurrentPos - nLastLineFeedPos);
     }
@@ -237,7 +237,7 @@ sal_uInt32 SaxWriterHelper::writeSequence()
     return 0;
 }
 
-void SaxWriterHelper::AddBytes(sal_Int8* pTarget, sal_uInt32& rPos, const 
sal_Int8* pBytes,
+void SaxWriterHelper::AddBytes(sal_Int8* pTarget, sal_uInt64& rPos, const 
sal_Int8* pBytes,
                                sal_uInt32 nBytesCount)
 {
     OSL_ENSURE((rPos + nBytesCount) > SEQUENCESIZE, "wrong use of 
AddBytesMethod");
@@ -279,7 +279,7 @@ void SaxWriterHelper::setCustomEntityNames(
  */
 bool SaxWriterHelper::convertToXML(const sal_Unicode* pStr, sal_Int32 nStrLen,
                                    bool bDoNormalization, bool 
bNormalizeWhitespace,
-                                   sal_Int8* pTarget, sal_uInt32& rPos)
+                                   sal_Int8* pTarget, sal_uInt64& rPos)
 {
     bool bRet(true);
     sal_uInt32 nSurrogate = 0;
commit ec3a22ca6735cb002e0603b2bf8b00976c03b642
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Sep 18 13:14:49 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Sep 18 15:22:04 2025 +0200

    reduce warning spam in connectivity
    
    Change-Id: Iba03e3e18586b8d40775c11ec0156a522fa5dac8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191118
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/connectivity/source/parse/sqlflex.l 
b/connectivity/source/parse/sqlflex.l
index 44daeb236bf7..b57b04235572 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -106,6 +106,12 @@ static void do_fatal_error(const char* msg)
     do_fatal_error(msg);    \
 }
 
+// silence some annoying warnings in the generated code, that we can do 
nothing about.
+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
+#pragma GCC diagnostic ignored "-Wunreachable-code"
+#pragma clang diagnostic ignored "-Wunreachable-code"
+
 %}
 
 %s SQL

Reply via email to