diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index 12a2de6..99a12dc 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,8 @@ /fribidi-1.0.9.tar.xz /fribidi-1.0.10.tar.xz /fribidi-1.0.11.tar.xz +/fribidi-1.0.12.tar.xz +/fribidi-1.0.13.tar.xz +/fribidi-1.0.14.tar.xz +/fribidi-1.0.15.tar.xz +/fribidi-1.0.16.tar.xz diff --git a/fribidi-CVE-2022-25308.patch b/fribidi-CVE-2022-25308.patch deleted file mode 100644 index dbdbe5a..0000000 --- a/fribidi-CVE-2022-25308.patch +++ /dev/null @@ -1,48 +0,0 @@ -From ad3a19e6372b1e667128ed1ea2f49919884587e1 Mon Sep 17 00:00:00 2001 -From: Akira TAGOH -Date: Thu, 17 Feb 2022 17:30:12 +0900 -Subject: [PATCH 1/3] Fix the stack buffer overflow issue - -strlen() could returns 0. Without a conditional check for len, -accessing S_ pointer with len - 1 may causes a stack buffer overflow. - -AddressSanitizer reports this like: -==1219243==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffdce043c1f at pc 0x000000403547 bp 0x7ffdce0 -43b30 sp 0x7ffdce043b28 -READ of size 1 at 0x7ffdce043c1f thread T0 - #0 0x403546 in main ../bin/fribidi-main.c:393 - #1 0x7f226804e58f in __libc_start_call_main (/lib64/libc.so.6+0x2d58f) - #2 0x7f226804e648 in __libc_start_main_impl (/lib64/libc.so.6+0x2d648) - #3 0x4036f4 in _start (/tmp/fribidi/build/bin/fribidi+0x4036f4) - -Address 0x7ffdce043c1f is located in stack of thread T0 at offset 63 in frame - #0 0x4022bf in main ../bin/fribidi-main.c:193 - - This frame has 5 object(s): - [32, 36) 'option_index' (line 233) - [48, 52) 'base' (line 386) - [64, 65064) 'S_' (line 375) <== Memory access at offset 63 underflows this variable - [65328, 130328) 'outstring' (line 385) - [130592, 390592) 'logical' (line 384) - -This fixes https://github.com/fribidi/fribidi/issues/181 ---- - bin/fribidi-main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/bin/fribidi-main.c b/bin/fribidi-main.c -index 3cf9fe1..3ae4fb6 100644 ---- a/bin/fribidi-main.c -+++ b/bin/fribidi-main.c -@@ -390,7 +390,7 @@ FRIBIDI_END_IGNORE_DEPRECATIONS - S_[sizeof (S_) - 1] = 0; - len = strlen (S_); - /* chop */ -- if (S_[len - 1] == '\n') -+ if (len > 0 && S_[len - 1] == '\n') - { - len--; - S_[len] = '\0'; --- -2.35.1 - diff --git a/fribidi-CVE-2022-25309.patch b/fribidi-CVE-2022-25309.patch deleted file mode 100644 index 454a5ed..0000000 --- a/fribidi-CVE-2022-25309.patch +++ /dev/null @@ -1,30 +0,0 @@ -From f22593b82b5d1668d1997dbccd10a9c31ffea3b3 Mon Sep 17 00:00:00 2001 -From: Dov Grobgeld -Date: Fri, 25 Mar 2022 09:09:49 +0300 -Subject: [PATCH 2/3] Protected against garbage in the CapRTL encoder - ---- - lib/fribidi-char-sets-cap-rtl.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/lib/fribidi-char-sets-cap-rtl.c b/lib/fribidi-char-sets-cap-rtl.c -index b0c0e4a..f74e010 100644 ---- a/lib/fribidi-char-sets-cap-rtl.c -+++ b/lib/fribidi-char-sets-cap-rtl.c -@@ -232,7 +232,12 @@ fribidi_cap_rtl_to_unicode ( - } - } - else -- us[j++] = caprtl_to_unicode[(int) s[i]]; -+ { -+ if ((int)s[i] < 0) -+ us[j++] = '?'; -+ else -+ us[j++] = caprtl_to_unicode[(int) s[i]]; -+ } - } - - return j; --- -2.35.1 - diff --git a/fribidi-CVE-2022-25310.patch b/fribidi-CVE-2022-25310.patch deleted file mode 100644 index 09fd1c3..0000000 --- a/fribidi-CVE-2022-25310.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 175850b03e1af251d705c1d04b2b9b3c1c06e48f Mon Sep 17 00:00:00 2001 -From: Akira TAGOH -Date: Thu, 17 Feb 2022 19:06:10 +0900 -Subject: [PATCH 3/3] Fix SEGV issue in fribidi_remove_bidi_marks - -Escape from fribidi_remove_bidi_marks() immediately if str is null. - -This fixes https://github.com/fribidi/fribidi/issues/183 ---- - lib/fribidi.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/fribidi.c b/lib/fribidi.c -index f5da0da..70bdab2 100644 ---- a/lib/fribidi.c -+++ b/lib/fribidi.c -@@ -74,7 +74,7 @@ fribidi_remove_bidi_marks ( - fribidi_boolean status = false; - - if UNLIKELY -- (len == 0) -+ (len == 0 || str == NULL) - { - status = true; - goto out; --- -2.35.1 - diff --git a/fribidi-drop-bundled-gnulib.patch b/fribidi-drop-bundled-gnulib.patch index 7857369..1315922 100644 --- a/fribidi-drop-bundled-gnulib.patch +++ b/fribidi-drop-bundled-gnulib.patch @@ -1,6 +1,6 @@ -diff -pruN fribidi-1.0.10.orig/bin/Makefile.am fribidi-1.0.10/bin/Makefile.am ---- fribidi-1.0.10.orig/bin/Makefile.am 2020-07-06 04:17:23.000000000 +0900 -+++ fribidi-1.0.10/bin/Makefile.am 2020-07-07 21:09:49.076237457 +0900 +diff -pruN fribidi-1.0.14.orig/bin/Makefile.am fribidi-1.0.14/bin/Makefile.am +--- fribidi-1.0.14.orig/bin/Makefile.am 2020-07-06 04:17:23.000000000 +0900 ++++ fribidi-1.0.14/bin/Makefile.am 2024-05-07 21:40:04.500166714 +0900 @@ -2,11 +2,9 @@ bin_PROGRAMS = fribidi noinst_PROGRAMS = fribidi-benchmark fribidi-bidi-types fribidi-caprtl2utf8 @@ -15,9 +15,9 @@ diff -pruN fribidi-1.0.10.orig/bin/Makefile.am fribidi-1.0.10/bin/Makefile.am AM_CPPFLAGS = \ @FRIBIDI_CPPFLAGS@ \ -diff -pruN fribidi-1.0.10.orig/bin/getopt.c fribidi-1.0.10/bin/getopt.c ---- fribidi-1.0.10.orig/bin/getopt.c 2015-08-05 03:49:07.000000000 +0900 -+++ fribidi-1.0.10/bin/getopt.c 1970-01-01 09:00:00.000000000 +0900 +diff -pruN fribidi-1.0.14.orig/bin/getopt.c fribidi-1.0.14/bin/getopt.c +--- fribidi-1.0.14.orig/bin/getopt.c 2015-08-05 03:49:07.000000000 +0900 ++++ fribidi-1.0.14/bin/getopt.c 1970-01-01 09:00:00.000000000 +0900 @@ -1,1268 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what @@ -1287,9 +1287,9 @@ diff -pruN fribidi-1.0.10.orig/bin/getopt.c fribidi-1.0.10/bin/getopt.c -} - -#endif /* TEST */ -diff -pruN fribidi-1.0.10.orig/bin/getopt.h fribidi-1.0.10/bin/getopt.h ---- fribidi-1.0.10.orig/bin/getopt.h 2015-08-05 03:49:07.000000000 +0900 -+++ fribidi-1.0.10/bin/getopt.h 1970-01-01 09:00:00.000000000 +0900 +diff -pruN fribidi-1.0.14.orig/bin/getopt.h fribidi-1.0.14/bin/getopt.h +--- fribidi-1.0.14.orig/bin/getopt.h 2015-08-05 03:49:07.000000000 +0900 ++++ fribidi-1.0.14/bin/getopt.h 1970-01-01 09:00:00.000000000 +0900 @@ -1,187 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989-1994,1996-1999,2001,2003,2004 @@ -1478,9 +1478,9 @@ diff -pruN fribidi-1.0.10.orig/bin/getopt.h fribidi-1.0.10/bin/getopt.h -#undef __need_getopt - -#endif /* getopt.h */ -diff -pruN fribidi-1.0.10.orig/bin/getopt1.c fribidi-1.0.10/bin/getopt1.c ---- fribidi-1.0.10.orig/bin/getopt1.c 2015-08-05 03:49:07.000000000 +0900 -+++ fribidi-1.0.10/bin/getopt1.c 1970-01-01 09:00:00.000000000 +0900 +diff -pruN fribidi-1.0.14.orig/bin/getopt1.c fribidi-1.0.14/bin/getopt1.c +--- fribidi-1.0.14.orig/bin/getopt1.c 2015-08-05 03:49:07.000000000 +0900 ++++ fribidi-1.0.14/bin/getopt1.c 1970-01-01 09:00:00.000000000 +0900 @@ -1,213 +0,0 @@ -/* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004 @@ -1695,9 +1695,9 @@ diff -pruN fribidi-1.0.10.orig/bin/getopt1.c fribidi-1.0.10/bin/getopt1.c -} - -#endif /* TEST */ -diff -pruN fribidi-1.0.10.orig/bin/getopt_int.h fribidi-1.0.10/bin/getopt_int.h ---- fribidi-1.0.10.orig/bin/getopt_int.h 2015-08-05 03:49:07.000000000 +0900 -+++ fribidi-1.0.10/bin/getopt_int.h 1970-01-01 09:00:00.000000000 +0900 +diff -pruN fribidi-1.0.14.orig/bin/getopt_int.h fribidi-1.0.14/bin/getopt_int.h +--- fribidi-1.0.14.orig/bin/getopt_int.h 2015-08-05 03:49:07.000000000 +0900 ++++ fribidi-1.0.14/bin/getopt_int.h 1970-01-01 09:00:00.000000000 +0900 @@ -1,145 +0,0 @@ -/* Internal declarations for getopt. - Copyright (C) 1989-1994,1996-1999,2001,2003,2004 @@ -1844,27 +1844,30 @@ diff -pruN fribidi-1.0.10.orig/bin/getopt_int.h fribidi-1.0.10/bin/getopt_int.h -); - -#endif /* getopt_int.h */ -diff -pruN fribidi-1.0.10.orig/bin/gettext.h fribidi-1.0.10/bin/gettext.h ---- fribidi-1.0.10.orig/bin/gettext.h 2015-08-05 03:49:07.000000000 +0900 -+++ fribidi-1.0.10/bin/gettext.h 1970-01-01 09:00:00.000000000 +0900 +diff -pruN fribidi-1.0.14.orig/bin/gettext.h fribidi-1.0.14/bin/gettext.h +--- fribidi-1.0.14.orig/bin/gettext.h 2015-08-05 03:49:07.000000000 +0900 ++++ fribidi-1.0.14/bin/gettext.h 1970-01-01 09:00:00.000000000 +0900 @@ -1,2 +0,0 @@ -#undef gettext -#define gettext -diff -pruN fribidi-1.0.10.orig/bin/meson.build fribidi-1.0.10/bin/meson.build ---- fribidi-1.0.10.orig/bin/meson.build 2020-07-06 04:17:23.000000000 +0900 -+++ fribidi-1.0.10/bin/meson.build 2020-07-07 21:10:30.931408884 +0900 -@@ -1,12 +1,12 @@ +diff -pruN fribidi-1.0.14.orig/bin/meson.build fribidi-1.0.14/bin/meson.build +--- fribidi-1.0.14.orig/bin/meson.build 2024-03-18 03:10:09.000000000 +0900 ++++ fribidi-1.0.14/bin/meson.build 2024-05-07 21:40:55.573086578 +0900 +@@ -1,7 +1,7 @@ + # The fribidi binary is used by the test setup, so if bin=false we still + # need to build it for internal usage, we just won't install it. fribidi = executable('fribidi', - 'fribidi-main.c', 'getopt.c', 'getopt1.c', fribidi_unicode_version_h, + 'fribidi-main.c', fribidi_unicode_version_h, - c_args: ['-DHAVE_CONFIG_H'] + fribidi_static_cargs + visibility_args, + c_args: ['-DHAVE_CONFIG_H'] + fribidi_static_cargs, include_directories: incs, link_with: libfribidi, - install: true) +@@ -12,7 +12,7 @@ if not get_option('bin') + endif executable('fribidi-benchmark', - 'fribidi-benchmark.c', 'getopt.c', 'getopt1.c', fribidi_unicode_version_h, + 'fribidi-benchmark.c', fribidi_unicode_version_h, - c_args: ['-DHAVE_CONFIG_H'] + fribidi_static_cargs + visibility_args, + c_args: ['-DHAVE_CONFIG_H'] + fribidi_static_cargs, include_directories: incs, link_with: libfribidi, diff --git a/fribidi.spec b/fribidi.spec index 3af25a2..91570fa 100644 --- a/fribidi.spec +++ b/fribidi.spec @@ -1,10 +1,10 @@ Summary: Library implementing the Unicode Bidirectional Algorithm Name: fribidi -Version: 1.0.11 +Version: 1.0.16 Release: 3%{?dist} URL: https://github.com/fribidi/fribidi/ Source: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.xz -License: LGPLv2+ and UCD +License: LGPL-2.1-or-later AND Unicode-DFS-2016 BuildRequires: gcc %if 0%{?rhel} && 0%{?rhel} <= 8 BuildRequires: automake autoconf libtool @@ -13,9 +13,6 @@ BuildRequires: meson %endif BuildRequires: make Patch0: fribidi-drop-bundled-gnulib.patch -Patch1: fribidi-CVE-2022-25308.patch -Patch2: fribidi-CVE-2022-25309.patch -Patch3: fribidi-CVE-2022-25310.patch %description A library to handle bidirectional scripts (for example Hebrew, Arabic), @@ -35,6 +32,10 @@ FriBidi. %if 0%{?rhel} && 0%{?rhel} <= 8 autoreconf -i %endif +# Clean up older file in archive +(cd lib; + rm arabic-shaping.tab.i bidi-type.tab.i brackets*.tab.i joining-type.tab.i mirroring.tab.i fribidi-unicode-version.h +) %build %if 0%{?rhel} && 0%{?rhel} <= 8 @@ -87,6 +88,57 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la #%%{_mandir}/man3/*.gz %changelog +* Wed Jul 23 2025 Fedora Release Engineering - 1.0.16-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Thu Jan 16 2025 Fedora Release Engineering - 1.0.16-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Fri Sep 27 2024 Akira TAGOH - 1.0.16-1 +- New upstream release. + Resolves: rhbz#2314907 + +* Wed Jul 17 2024 Fedora Release Engineering - 1.0.15-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Mon Jun 10 2024 Akira TAGOH - 1.0.15-1 +- New upstream release. + Resolves: rhbz#2291030 + +* Wed Jun 5 2024 Akira TAGOH - 1.0.14-2 +- Fix broken data in fribidi. + Resolves: rhbz#2279842 + +* Tue May 7 2024 Akira TAGOH - 1.0.14-1 +- New upstream release. + Resolves: rhbz#2277227 + +* Wed Jan 24 2024 Fedora Release Engineering - 1.0.13-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jan 19 2024 Fedora Release Engineering - 1.0.13-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Jul 19 2023 Fedora Release Engineering - 1.0.13-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Wed May 17 2023 Akira TAGOH - 1.0.13-1 +- New upstream release. + Resolves: rhbz#2207796 + +* Fri Feb 24 2023 Caolán McNamara - 1.0.12-4 +- migrated to SPDX license + +* Thu Jan 19 2023 Fedora Release Engineering - 1.0.12-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering - 1.0.12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Apr 21 2022 Akira TAGOH - 1.0.12-1 +- New upstream release. + Resolves: rhbz#2077311 + * Fri Apr 1 2022 Akira TAGOH - 1.0.11-3 - Fix security issues, CVE-2022-25308, CVE-2022-25309, CVE-2022-25310. Resolves: rhbz#2067039, rhbz#2067043, rhbz#2067045 @@ -337,4 +389,3 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la * Fri May 16 2003 Jeremy Katz 0.10.4-2 - Initial build in Red Hat Linux - diff --git a/plans/basic.fmf b/plans/basic.fmf new file mode 100644 index 0000000..4d7984e --- /dev/null +++ b/plans/basic.fmf @@ -0,0 +1,11 @@ +summary: Basic smoke test +discover: + how: fmf + dist-git-source: true +prepare: + name: tmt + how: install + package: + - fribidi +execute: + how: tmt diff --git a/sources b/sources index b35a6c5..173f0f4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (fribidi-1.0.11.tar.xz) = 6afde86784de06759f18235ccb44f23261a975f7cce0021b16755065a6a8ed84d7d5fb7fdcaadd691b48011efb4bfc2ee67555e5133a294a418cca1a0c85476c +SHA512 (fribidi-1.0.16.tar.xz) = e3a56f36155f6813e3609473639fc533de742309f561c463012dc90b412a1ac7694b765d92669b2cbfaee973ca0e92fa5e926e68a1a078921f26ef17d82ab651 diff --git a/tests/basic/main.fmf b/tests/basic/main.fmf new file mode 100644 index 0000000..4b2193c --- /dev/null +++ b/tests/basic/main.fmf @@ -0,0 +1,3 @@ +summary: Basic test +test: ./test.sh +framework: beakerlib diff --git a/tests/basic/test.sh b/tests/basic/test.sh new file mode 100755 index 0000000..3156eac --- /dev/null +++ b/tests/basic/test.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup + rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" + rlRun "pushd $tmp" + rlRun "set -o pipefail" + rlPhaseEnd + + rlPhaseStartTest + rlRun "BUILD_PATH=$(rpm -q --qf '%{NAME}-%{VERSION}' fribidi)" 0 "Get the build path" + if test -d $TMT_SOURCE_DIR/$BUILD_PATH; then + for f in $TMT_SOURCE_DIR/$BUILD_PATH/test/*.input; do + ref=${f/.input/.reference} + cs=$(echo $f|cut -d_ -f2) + name=$(basename $f) + rlRun "fribidi -t -c $cs $f | tee output" 0 "Check $name for $cs" + rlRun "diff -U 0 output $ref" 0 "Check diff for $name" + done + else + rlDie "No build directory" + fi + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $tmp" 0 "Remove tmp directory" + rlPhaseEnd +rlJournalEnd