From 05aa6f7f4d609cb24e9417b8e774ec4b6687b911 Mon Sep 17 00:00:00 2001 From: jinzhimin369 Date: Wed, 13 Jan 2021 18:01:33 +0800 Subject: [PATCH] fix CVE-2019-16707 --- backport-CVE-2019-16707.patch | 22 ++++++++++++++++++++++ hunspell.spec | 8 +++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 backport-CVE-2019-16707.patch diff --git a/backport-CVE-2019-16707.patch b/backport-CVE-2019-16707.patch new file mode 100644 index 0000000..649eef5 --- /dev/null +++ b/backport-CVE-2019-16707.patch @@ -0,0 +1,22 @@ +From ac938e2ecb48ab4dd21298126c7921689d60571b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 12 Nov 2019 20:03:15 +0000 +Subject: [PATCH] invalid read memory access #624 + +--- + src/hunspell/suggestmgr.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/hunspell/suggestmgr.cxx b/src/hunspell/suggestmgr.cxx +index dba084e9..c23f165a 100644 +--- a/src/hunspell/suggestmgr.cxx ++++ b/src/hunspell/suggestmgr.cxx +@@ -2040,7 +2040,7 @@ int SuggestMgr::leftcommonsubstring( + int l2 = su2.size(); + // decapitalize dictionary word + if (complexprefixes) { +- if (su1[l1 - 1] == su2[l2 - 1]) ++ if (l1 && l2 && su1[l1 - 1] == su2[l2 - 1]) + return 1; + } else { + unsigned short idx = su2.empty() ? 0 : (su2[0].h << 8) + su2[0].l; diff --git a/hunspell.spec b/hunspell.spec index 4833948..182ee93 100644 --- a/hunspell.spec +++ b/hunspell.spec @@ -1,9 +1,12 @@ Name: hunspell Summary: A spell checker and morphological analyzer library Version: 1.7.0 -Release: 5 +Release: 6 URL: https://github.com/hunspell/hunspell Source: https://github.com/hunspell/hunspell/archive/%{name}-%{version}.tar.gz + +Patch1: backport-CVE-2019-16707.patch + License: LGPLv2+ or GPLv2+ or MPLv1.1 BuildRequires: gcc-c++ autoconf automake libtool ncurses-devel gettext BuildRequires: perl-generators words hunspell hunspell-devel gdb @@ -83,6 +86,9 @@ cp -a %{_libdir}/libhunspell-1.6.so* %{buildroot}%{_libdir} %lang(hu) %{_mandir}/hu/man1/hunspell.1.gz %changelog +* Wed Jan 13 2021 jinzhimin - 1.7.0-6 +- fix CVE-2019-16707 + * Sat Mar 21 2020 songnannan - 1.7.0.5 - bugfix about make check