download.lst                             |    4 +--
 external/freetype/freetype-2.6.5.patch.1 |   36 +++++++++++++++----------------
 external/freetype/ubsan.patch            |   17 ++------------
 3 files changed, 23 insertions(+), 34 deletions(-)

New commits:
commit 517ea6e0a0cc9f3bebeaa2bad0d5c4fff21482c7
Author:     Taichi Haradaguchi <20001...@ymail.ne.jp>
AuthorDate: Tue Feb 21 20:14:33 2023 +0900
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Fri May 19 13:57:00 2023 +0200

    freetype: upgrade to release 2.13.0
    
    Fixes CVE-2023-2004.[1]
    
    As the issue has been fixed upstream[2], removed some codes from 
"external/freetype/ubsan.patch".
    
    [1] "CVE-2023-2094"
    <https://security-tracker.debian.org/tracker/CVE-2023-2004>
    
    [2] "[truetype] Fix undefined pointer arithmetic."
    
<https://gitlab.freedesktop.org/freetype/freetype/-/commit/905270925dd0492ba557e58938e5513f062e6fc5>
    
    Change-Id: I66c11e414cd9ecdad8678487d0c3f645a352ad92
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147464
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit 803e3a63d879d8095b53b020cb648522fcb2af99)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151922
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Tested-by: Jenkins

diff --git a/download.lst b/download.lst
index 8e7326daa777..d68415d9bb6d 100644
--- a/download.lst
+++ b/download.lst
@@ -198,8 +198,8 @@ FREEHAND_TARBALL := libfreehand-0.1.2.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-FREETYPE_SHA256SUM := 
ef5c336aacc1a079ff9262d6308d6c2a066dd4d2a905301c4adda9b354399033
-FREETYPE_TARBALL := freetype-2.12.0.tar.xz
+FREETYPE_SHA256SUM := 
5ee23abd047636c24b2d43c6625dcafc66661d1aca64dec9e0d05df29592624c
+FREETYPE_TARBALL := freetype-2.13.0.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git a/external/freetype/freetype-2.6.5.patch.1 
b/external/freetype/freetype-2.6.5.patch.1
index c10c0bb38ea8..544e4fa496a6 100644
--- a/external/freetype/freetype-2.6.5.patch.1
+++ b/external/freetype/freetype-2.6.5.patch.1
@@ -1,7 +1,7 @@
 diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure
---- freetype/builds/unix/configure.dt  2017-02-01 22:14:45.206257952 +0100
-+++ freetype/builds/unix/configure     2017-02-01 22:16:31.076183707 +0100
-@@ -9386,7 +9386,7 @@
+--- freetype/builds/unix/configure.dt  2023-02-09 15:33:17.000000000 +0900
++++ freetype/builds/unix/configure     2023-02-22 16:53:49.547740397 +0900
+@@ -9523,7 +9523,7 @@ _LT_EOF
        case $host_cpu in
        powerpc)
              # see comment about AmigaOS4 .so support
@@ -10,7 +10,7 @@ diff -up freetype/builds/unix/configure.dt 
freetype/builds/unix/configure
              archive_expsym_cmds=''
          ;;
        m68k)
-@@ -9402,7 +9402,7 @@
+@@ -9539,7 +9539,7 @@ _LT_EOF
        allow_undefined_flag=unsupported
        # Joseph Beckenbach <j...@best.com> says some releases of gcc
        # support --undefined.  This deserves some investigation.  FIXME
@@ -19,7 +19,7 @@ diff -up freetype/builds/unix/configure.dt 
freetype/builds/unix/configure
        else
        ld_shlibs=no
        fi
-@@ -9436,7 +9436,7 @@
+@@ -9573,7 +9573,7 @@ _LT_EOF
        ;;
  
      haiku*)
@@ -28,7 +28,7 @@ diff -up freetype/builds/unix/configure.dt 
freetype/builds/unix/configure
        link_all_deplibs=yes
        ;;
  
-@@ -9531,13 +9531,13 @@
+@@ -9669,13 +9669,13 @@ _LT_EOF
        *Sun\ F*)                       # Sun Fortran 8.3
          tmp_sharedflag='-G' ;;
        esac
@@ -37,14 +37,14 @@ diff -up freetype/builds/unix/configure.dt 
freetype/builds/unix/configure
  
          if test yes = "$supports_anon_versioning"; then
            archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> 
$output_objdir/$libname.ver~
+             cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> 
$output_objdir/$libname.ver~
              echo "local: *; };" >> $output_objdir/$libname.ver~
 -            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs 
$compiler_flags $wl-soname $wl$soname $wl-version-script 
$wl$output_objdir/$libname.ver -o $lib'
 +            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs 
$compiler_flags $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
          fi
  
        case $cc_basename in
-@@ -9567,8 +9567,8 @@
+@@ -9705,8 +9705,8 @@ _LT_EOF
        archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
        wlarc=
        else
@@ -55,7 +55,7 @@ diff -up freetype/builds/unix/configure.dt 
freetype/builds/unix/configure
        fi
        ;;
  
-@@ -9586,8 +9586,8 @@
+@@ -9724,8 +9724,8 @@ _LT_EOF
  
  _LT_EOF
        elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; 
then
@@ -66,7 +66,7 @@ diff -up freetype/builds/unix/configure.dt 
freetype/builds/unix/configure
        else
        ld_shlibs=no
        fi
-@@ -9615,8 +9615,8 @@
+@@ -9753,8 +9753,8 @@ _LT_EOF
          # requires that you compile everything twice, which is a pain.
          if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; 
then
            hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
@@ -77,7 +77,7 @@ diff -up freetype/builds/unix/configure.dt 
freetype/builds/unix/configure
          else
            ld_shlibs=no
          fi
-@@ -9633,8 +9633,8 @@
+@@ -9771,8 +9771,8 @@ _LT_EOF
  
      *)
        if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; 
then
@@ -88,7 +88,7 @@ diff -up freetype/builds/unix/configure.dt 
freetype/builds/unix/configure
        else
        ld_shlibs=no
        fi
-@@ -9937,7 +9937,7 @@
+@@ -10075,7 +10075,7 @@ fi
        case $host_cpu in
        powerpc)
              # see comment about AmigaOS4 .so support
@@ -97,7 +97,7 @@ diff -up freetype/builds/unix/configure.dt 
freetype/builds/unix/configure
              archive_expsym_cmds=''
          ;;
        m68k)
-@@ -10207,7 +10207,7 @@
+@@ -10345,7 +10345,7 @@ fi
  
      irix5* | irix6* | nonstopux*)
        if test yes = "$GCC"; then
@@ -106,7 +106,7 @@ diff -up freetype/builds/unix/configure.dt 
freetype/builds/unix/configure
        # Try to use the -exported_symbol ld option, if it does not
        # work, assume that -exports_file does not work either and
        # implicitly export all symbols.
-@@ -10237,7 +10237,7 @@
+@@ -10375,7 +10375,7 @@ fi
  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: 
$lt_cv_irix_exported_symbol" >&5
  printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
        if test yes = "$lt_cv_irix_exported_symbol"; then
@@ -115,7 +115,7 @@ diff -up freetype/builds/unix/configure.dt 
freetype/builds/unix/configure
        fi
        else
        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname 
$soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` 
-update_registry $output_objdir/so_locations -o $lib'
-@@ -10332,7 +10332,7 @@
+@@ -10471,7 +10471,7 @@ printf "%s\n" "$lt_cv_irix_exported_symb
      osf3*)
        if test yes = "$GCC"; then
        allow_undefined_flag=' $wl-expect_unresolved $wl\*'
@@ -124,7 +124,7 @@ diff -up freetype/builds/unix/configure.dt 
freetype/builds/unix/configure
        else
        allow_undefined_flag=' -expect_unresolved \*'
        archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs 
$compiler_flags -soname $soname `test -n "$verstring" && func_echo_all 
"-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-@@ -10345,7 +10345,7 @@
+@@ -10484,7 +10484,7 @@ printf "%s\n" "$lt_cv_irix_exported_symb
      osf4* | osf5*)    # as osf3* with the addition of -msym flag
        if test yes = "$GCC"; then
        allow_undefined_flag=' $wl-expect_unresolved $wl\*'
@@ -133,7 +133,7 @@ diff -up freetype/builds/unix/configure.dt 
freetype/builds/unix/configure
        hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
        else
        allow_undefined_flag=' -expect_unresolved \*'
-@@ -13620,10 +13620,10 @@
+@@ -13755,10 +13755,10 @@ if test "x$GCC" = xyes; then
    XX_CFLAGS="-Wall"
    case "$host" in
    *-*-mingw*)
@@ -146,7 +146,7 @@ diff -up freetype/builds/unix/configure.dt 
freetype/builds/unix/configure
      ;;
    *)
      XX_ANSIFLAGS=""
-@@ -13661,7 +13661,7 @@
+@@ -13796,7 +13796,7 @@ if ac_fn_c_try_compile "$LINENO"
  then :
    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok, adding to 
XX_ANSIFLAGS" >&5
  printf "%s\n" "ok, adding to XX_ANSIFLAGS" >&6; }
diff --git a/external/freetype/ubsan.patch b/external/freetype/ubsan.patch
index b27bbba09cb8..80446ac5c89c 100644
--- a/external/freetype/ubsan.patch
+++ b/external/freetype/ubsan.patch
@@ -1,17 +1,6 @@
---- src/truetype/ttgxvar.c
-+++ src/truetype/ttgxvar.c
-@@ -964,7 +964,7 @@
-     /* in the OpenType specification.                  */
- 
-     varData  = &itemStore->varData[outerIndex];
--    deltaSet = &varData->deltaSet[varData->regionIdxCount * innerIndex];
-+    deltaSet = varData->regionIdxCount * innerIndex == 0 ? varData->deltaSet 
: &varData->deltaSet[varData->regionIdxCount * innerIndex];
- 
-     /* outer loop steps through master designs to be blended */
-     for ( master = 0; master < varData->regionIdxCount; master++ )
---- src/psaux/psobjs.c.orig    2022-11-17 16:52:21.913211573 +0100
-+++ src/psaux/psobjs.c 2022-11-17 16:53:17.905127207 +0100
-@@ -201,7 +201,8 @@
+--- src/psaux/psobjs.c.orig    2023-02-04 23:00:05.000000000 +0900
++++ src/psaux/psobjs.c 2023-02-22 16:28:26.632283841 +0900
+@@ -200,7 +200,8 @@
      /* add the object to the base block and adjust offset */
      table->elements[idx] = FT_OFFSET( table->block, table->cursor );
      table->lengths [idx] = length;

Reply via email to