download.lst                                    |    4 +-
 external/expat/0001-Fix-compiler-warnings.patch |   47 ++++++++++++++++++++++++
 external/expat/UnpackedTarball_expat.mk         |    3 +
 sc/source/filter/rtf/rtfparse.cxx               |    4 +-
 4 files changed, 54 insertions(+), 4 deletions(-)

New commits:
commit d8b1133a8fb9ddee010a9a38a25453f3b245ea9f
Author:     Taichi Haradaguchi <20001...@ymail.ne.jp>
AuthorDate: Fri Feb 9 03:42:30 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Feb 22 21:21:47 2024 +0100

    Expat: upgrade to release 2.6.0
    
    Fixes CVE-2023-52425 and CVE-2023-52426.
    
    Change-Id: Id135bbaea893a83129bdbee44948c09322a64c07
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163146
    Tested-by: Jenkins
    Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp>
    (cherry picked from commit b7e4078033b064bfc3847db0916a4df389117817)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163392
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit 66022adfa09662a082272f42bf0c34582abf38b1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163397
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
    Tested-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/download.lst b/download.lst
index 5470e07c65eb..20e5b5c417ee 100644
--- a/download.lst
+++ b/download.lst
@@ -111,8 +111,8 @@ ETONYEK_TARBALL := 
libetonyek-0.1.$(ETONYEK_VERSION_MICRO).tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-EXPAT_SHA256SUM := 
ef2420f0232c087801abf705e89ae65f6257df6b7931d37846a193ef2e8cdcbe
-EXPAT_TARBALL := expat-2.5.0.tar.xz
+EXPAT_SHA256SUM := 
cb5f5a8ea211e1cabd59be0a933a52e3c02cc326e86a4d387d8d218e7ee47a3e
+EXPAT_TARBALL := expat-2.6.0.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git a/external/expat/0001-Fix-compiler-warnings.patch 
b/external/expat/0001-Fix-compiler-warnings.patch
new file mode 100644
index 000000000000..adec5ed0d9be
--- /dev/null
+++ b/external/expat/0001-Fix-compiler-warnings.patch
@@ -0,0 +1,47 @@
+From 3f60a47cb5716bb810789a12ef6024c1dc448164 Mon Sep 17 00:00:00 2001
+From: Taichi Haradaguchi <20001...@ymail.ne.jp>
+Date: Fri, 9 Feb 2024 19:28:35 +0900
+Subject: [PATCH] Fix compiler warnings
+
+> In file included from ./../lib/internal.h:149,
+>                  from codepage.c:38:
+> ./../lib/expat.h:1045:5: warning: "XML_GE" is not defined, evaluates to 0 
[-Wundef]
+>  1045 | #if XML_GE == 1
+>       |     ^~~~~~
+> ./../lib/internal.h:158:5: warning: "XML_GE" is not defined, evaluates to 0 
[-Wundef]
+>   158 | #if XML_GE == 1
+>       |     ^~~~~~
+---
+ expat/lib/expat.h    | 2 +-
+ expat/lib/internal.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/expat/lib/expat.h b/expat/lib/expat.h
+index 95464b0d..79bbfb61 100644
+--- a/expat/lib/expat.h
++++ b/expat/lib/expat.h
+@@ -1042,7 +1042,7 @@ typedef struct {
+ XMLPARSEAPI(const XML_Feature *)
+ XML_GetFeatureList(void);
+ 
+-#if XML_GE == 1
++#if defined(XML_GE) && XML_GE == 1
+ /* Added in Expat 2.4.0 for XML_DTD defined and
+  * added in Expat 2.6.0 for XML_GE == 1. */
+ XMLPARSEAPI(XML_Bool)
+diff --git a/expat/lib/internal.h b/expat/lib/internal.h
+index cce71e4c..208c6b67 100644
+--- a/expat/lib/internal.h
++++ b/expat/lib/internal.h
+@@ -155,7 +155,7 @@ extern "C" {
+ void _INTERNAL_trim_to_complete_utf8_characters(const char *from,
+                                                 const char **fromLimRef);
+ 
+-#if XML_GE == 1
++#if defined(XML_GE) && XML_GE == 1
+ unsigned long long testingAccountingGetCountBytesDirect(XML_Parser parser);
+ unsigned long long testingAccountingGetCountBytesIndirect(XML_Parser parser);
+ const char *unsignedCharToPrintable(unsigned char c);
+-- 
+2.43.1
+
diff --git a/external/expat/UnpackedTarball_expat.mk 
b/external/expat/UnpackedTarball_expat.mk
index 5d4f41f6d147..465105f2ca8c 100644
--- a/external/expat/UnpackedTarball_expat.mk
+++ b/external/expat/UnpackedTarball_expat.mk
@@ -13,7 +13,10 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,expat,$(EXPAT_TARBALL)))
 
 $(eval $(call gb_UnpackedTarball_update_autoconf_configs,expat,conftools))
 
+# * external/expat/0001-Fix-compiler-warnings.patch was sent to upstream as
+#   <https://github.com/libexpat/libexpat/pull/819> "Fix compiler warnings":
 $(eval $(call gb_UnpackedTarball_add_patches,expat,\
+       external/expat/0001-Fix-compiler-warnings.patch \
        external/expat/expat-winapi.patch \
 ))
 
commit 7564f8651012ed0cbfbe6d37cd4effba308a2cd4
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Fri Feb 16 19:31:57 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Feb 22 21:21:40 2024 +0100

    tdf#101313 Copy-paste table from writer to calc
    
    With Merged Cells from Writer to Calc,
    Cells Placed in Wrong Position (Wrong cell offsets).
    
    regression from
        commit ed24564ce11683731b820c29d5a46e073ab7a2a7
        Author: Noel Grandin <n...@peralex.com>
        Date:   Thu Jul 19 15:22:31 2012 +0200
        SV_DECL_VARARR_SORT(ScRTFColTwips) o3tl::sorted_vector
    
    Change-Id: I8c90c19f6a27a368fd5807b3eaab84ce820e26e5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163518
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit 4df426e429e1aed92f074d8acd3ba3a5ec335ba9)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163532
    (cherry picked from commit b5a5cae0e78e989c421a376bb55a724981c74d87)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163545
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
    Tested-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/filter/rtf/rtfparse.cxx 
b/sc/source/filter/rtf/rtfparse.cxx
index b2d2b8c2521f..0617a86c62b1 100644
--- a/sc/source/filter/rtf/rtfparse.cxx
+++ b/sc/source/filter/rtf/rtfparse.cxx
@@ -101,8 +101,8 @@ inline void ScRTFParser::NextRow()
 
 bool ScRTFParser::SeekTwips( sal_uInt16 nTwips, SCCOL* pCol )
 {
-    ScRTFColTwips::const_iterator it = aColTwips.find( nTwips );
-    bool bFound = it != aColTwips.end();
+    ScRTFColTwips::const_iterator it = aColTwips.lower_bound( nTwips );
+    bool bFound = it != aColTwips.end() && *it == nTwips;
     sal_uInt16 nPos = it - aColTwips.begin();
     *pCol = static_cast<SCCOL>(nPos);
     if ( bFound )

Reply via email to