From e8d9426afb65d2b13e4f534a1569017fb60d6774 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mar 06 2017 11:04:38 +0000 Subject: Resolves: rhbz#1429258 survive .dics which appear to be empty --- diff --git a/0001-Fix-possible-division-with-zero-in-hashmgr-issue-154.patch b/0001-Fix-possible-division-with-zero-in-hashmgr-issue-154.patch new file mode 100644 index 0000000..fb620b5 --- /dev/null +++ b/0001-Fix-possible-division-with-zero-in-hashmgr-issue-154.patch @@ -0,0 +1,35 @@ +From d1c7de132e45a57dbc45818935bd29792fd4772b Mon Sep 17 00:00:00 2001 +From: Dimitrij Mijoski +Date: Wed, 16 Nov 2016 02:29:35 +0100 +Subject: [PATCH] Fix possible division with zero in hashmgr, issue #154 and + #245 + +--- + src/hunspell/hashmgr.cxx | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/src/hunspell/hashmgr.cxx b/src/hunspell/hashmgr.cxx +index 072bc1a..19d33c8 100644 +--- a/src/hunspell/hashmgr.cxx ++++ b/src/hunspell/hashmgr.cxx +@@ -104,11 +104,13 @@ HashMgr::HashMgr(const char* tpath, const char* apath, const char* key) + if (ec) { + /* error condition - what should we do here */ + HUNSPELL_WARNING(stderr, "Hash Manager Error : %d\n", ec); +- if (tableptr) { +- free(tableptr); +- tableptr = NULL; ++ free(tableptr); ++ //keep tablesize to 1 to fix possible division with zero ++ tablesize = 1; ++ tableptr = (struct hentry**)calloc(tablesize, sizeof(struct hentry*)); ++ if (!tableptr) { ++ tablesize = 0; + } +- tablesize = 0; + } + } + +-- +2.9.3 + diff --git a/hunspell.spec b/hunspell.spec index c375859..9299982 100644 --- a/hunspell.spec +++ b/hunspell.spec @@ -3,7 +3,7 @@ Name: hunspell Summary: A spell checker and morphological analyzer library Version: 1.4.1 -Release: 1%{?dist} +Release: 2%{?dist} Source: https://github.com/hunspell/hunspell/archive/v%{version}.tar.gz Group: System Environment/Libraries URL: https://github.com/hunspell/hunspell @@ -18,6 +18,7 @@ BuildRequires: valgrind BuildRequires: words %endif Requires: hunspell-en-US +Patch1: 0001-Fix-possible-division-with-zero-in-hashmgr-issue-154.patch %description Hunspell is a spell checker and morphological analyzer library and program @@ -35,6 +36,7 @@ Includes and definitions for developing with hunspell %prep %setup -q +%patch1 -p1 -b .rhbz1429258 %build configureflags="--disable-rpath --disable-static --with-ui --with-readline" @@ -122,6 +124,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man5/hunspell.5.gz %changelog +* Mon Mar 06 2017 Caolán McNamara - 1.4.1-2 +- Resolves: rhbz#1429258 survive .dics which appear to be empty + * Tue May 03 2016 Caolán McNamara - 1.4.1-1 - latest version