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
This commit is contained in:
Tomáš Chvátal 2018-09-27 10:02:52 +00:00 committed by Git OBS Bridge
parent a75cfdb483
commit 632ce993a4
3 changed files with 23 additions and 0 deletions

16
foma-fix-sizeof.patch Normal file
View File

@ -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);
}

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Sep 27 09:00:24 UTC 2018 - Bernhard Wiedemann <bwiedemann@suse.com>
- Add foma-fix-sizeof.patch to fix segfault on 32-bit (boo#1109949)
-------------------------------------------------------------------
Thu Sep 27 07:28:30 UTC 2018 - Tomáš Chvátal <tchvatal@suse.com>

View File

@ -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