From 632ce993a4f704448abce9ad5fd18bcb7bcdb36f1ab919fb756b16fca6f93e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 27 Sep 2018 10:02:52 +0000 Subject: [PATCH] Accepting request 638713 from home:bmwiedemann:branches:LibreOffice:Factory Add foma-fix-sizeof.patch to fix segfault on 32-bit (boo#1109949) OBS-URL: https://build.opensuse.org/request/show/638713 OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/foma?expand=0&rev=8 --- foma-fix-sizeof.patch | 16 ++++++++++++++++ foma.changes | 5 +++++ foma.spec | 2 ++ 3 files changed, 23 insertions(+) create mode 100644 foma-fix-sizeof.patch diff --git a/foma-fix-sizeof.patch b/foma-fix-sizeof.patch new file mode 100644 index 0000000..004585b --- /dev/null +++ b/foma-fix-sizeof.patch @@ -0,0 +1,16 @@ +https://bugzilla.opensuse.org/show_bug.cgi?id=1109949 +https://github.com/mhulden/foma/pull/78 + +Index: foma-0.9.18+git20170507.07bb944/foma/rewrite.c +=================================================================== +--- foma-0.9.18+git20170507.07bb944.orig/foma/rewrite.c ++++ foma-0.9.18+git20170507.07bb944/foma/rewrite.c +@@ -103,7 +103,7 @@ struct fsm *fsm_rewrite(struct rewrite_s + rb = xxcalloc(1, sizeof(struct rewrite_batch)); + rb->rewrite_set = all_rules; + rb->num_rules = num_rules; +- rb->namestrings = xxmalloc(sizeof rb->namestrings * num_rules); ++ rb->namestrings = xxmalloc(sizeof *rb->namestrings * num_rules); + for (i = 0; i < rb->num_rules; i++) { + sprintf(rb->namestrings[i], "@#%04i@", i+1); + } diff --git a/foma.changes b/foma.changes index 82460d0..d0345fb 100644 --- a/foma.changes +++ b/foma.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 27 09:00:24 UTC 2018 - Bernhard Wiedemann + +- Add foma-fix-sizeof.patch to fix segfault on 32-bit (boo#1109949) + ------------------------------------------------------------------- Thu Sep 27 07:28:30 UTC 2018 - Tomáš Chvátal diff --git a/foma.spec b/foma.spec index a64ec8e..46ad026 100644 --- a/foma.spec +++ b/foma.spec @@ -27,6 +27,7 @@ URL: https://fomafst.github.io/ # Source must be from git tarball has different license than git, no idea why Source0: foma-%{version}.tar.xz Patch0: foma-harden-build.patch +Patch1: foma-fix-sizeof.patch BuildRequires: bison BuildRequires: flex BuildRequires: ncurses-devel @@ -64,6 +65,7 @@ Finite-state C library development files and headers for %{name}. %prep %setup -q -n %{name}-%{version}/%{name} %patch0 -p2 +%patch1 -p2 sed -i '/^CFLAGS/c\CFLAGS = %{optflags} -Wl,--as-needed -D_GNU_SOURCE -std=c99 -fvisibility=hidden -fPIC' Makefile sed -i '/^LDFLAGS/c\LDFLAGS = -lreadline -lz -lreadline -fpic' Makefile sed -i '/^FLOOKUPLDFLAGS/c\FLOOKUPLDFLAGS = libfoma.a -lz -fpic' Makefile