Compare commits
14 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec71712f5c | ||
|
|
34553d821a |
||
|
|
e8c3928ddb | ||
|
|
84708febe1 | ||
|
|
f4c35362a1 | ||
|
|
ad33f2f898 | ||
|
|
6f346206b8 | ||
|
|
5675a2c400 | ||
|
|
868e83e3e8 | ||
|
|
937564ad74 | ||
|
|
40b55e12ac | ||
|
|
8ac6886a8a | ||
|
|
54639a08a5 | ||
|
|
c1da243e3a |
11 changed files with 191 additions and 47 deletions
1
.fmf/version
Normal file
1
.fmf/version
Normal file
|
|
@ -0,0 +1 @@
|
|||
1
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1 +1 @@
|
|||
/v1.7.0.tar.gz
|
||||
/hunspell-1.7.2.tar.gz
|
||||
|
|
|
|||
|
|
@ -0,0 +1,77 @@
|
|||
From e2fe9f86e1769b440972971240e9b8fb1cd53b97 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||
Date: Fri, 6 Jan 2023 16:20:45 +0000
|
||||
Subject: [PATCH] Resolves: rhbz#2158548 allow longer words for hunspell-ko
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
https://github.com/hunspell/hunspell/issues/903
|
||||
|
||||
A problem since the sanity check added in:
|
||||
|
||||
commit 05e44e069e4cfaa9ce1264bf13f23fc9abd7ed05
|
||||
Author: Caolán McNamara <caolanm@redhat.com>
|
||||
Date: Thu Sep 1 13:46:40 2022 +0100
|
||||
|
||||
Check word limit (#813)
|
||||
|
||||
* check against hentry blen max
|
||||
---
|
||||
src/hunspell/hashmgr.cxx | 6 +++---
|
||||
src/hunspell/htypes.hxx | 4 ++--
|
||||
tests/korean.dic | 3 ++-
|
||||
3 files changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/hunspell/hashmgr.cxx b/src/hunspell/hashmgr.cxx
|
||||
index 100916d..14201e9 100644
|
||||
--- a/src/hunspell/hashmgr.cxx
|
||||
+++ b/src/hunspell/hashmgr.cxx
|
||||
@@ -209,7 +209,7 @@ int HashMgr::add_word(const std::string& in_word,
|
||||
}
|
||||
|
||||
// limit of hp->blen
|
||||
- if (word->size() > std::numeric_limits<unsigned char>::max()) {
|
||||
+ if (word->size() > std::numeric_limits<unsigned short>::max()) {
|
||||
HUNSPELL_WARNING(stderr, "error: word len %ld is over max limit\n", word->size());
|
||||
delete desc_copy;
|
||||
delete word_copy;
|
||||
@@ -235,8 +235,8 @@ int HashMgr::add_word(const std::string& in_word,
|
||||
|
||||
int i = hash(hpw, word->size());
|
||||
|
||||
- hp->blen = (unsigned char)word->size();
|
||||
- hp->clen = (unsigned char)wcl;
|
||||
+ hp->blen = (unsigned short)word->size();
|
||||
+ hp->clen = (unsigned short)wcl;
|
||||
hp->alen = (short)al;
|
||||
hp->astr = aff;
|
||||
hp->next = NULL;
|
||||
diff --git a/src/hunspell/htypes.hxx b/src/hunspell/htypes.hxx
|
||||
index 44366b1..2b896fb 100644
|
||||
--- a/src/hunspell/htypes.hxx
|
||||
+++ b/src/hunspell/htypes.hxx
|
||||
@@ -62,8 +62,8 @@
|
||||
#endif
|
||||
|
||||
struct hentry {
|
||||
- unsigned char blen; // word length in bytes
|
||||
- unsigned char clen; // word length in characters (different for UTF-8 enc.)
|
||||
+ unsigned short blen; // word length in bytes
|
||||
+ unsigned short clen; // word length in characters (different for UTF-8 enc.)
|
||||
short alen; // length of affix flag vector
|
||||
unsigned short* astr; // affix flag vector
|
||||
struct hentry* next; // next word with same hash code
|
||||
diff --git a/tests/korean.dic b/tests/korean.dic
|
||||
index 95cb450..d76ea05 100644
|
||||
--- a/tests/korean.dic
|
||||
+++ b/tests/korean.dic
|
||||
@@ -1,3 +1,4 @@
|
||||
-2
|
||||
+3
|
||||
들어오세요
|
||||
안녕하세요
|
||||
+김수한무거북이와두루미삼천갑자동방삭치치카포사리사리세ᅡ워리워리세브리캉무드셀ᅡ구름위허ᅵ케ᅵᆫᅦ담벼락서생원에ᄀ양
|
||||
--
|
||||
2.38.1
|
||||
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
From ac938e2ecb48ab4dd21298126c7921689d60571b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||
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 dba084e..c23f165 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;
|
||||
--
|
||||
2.23.0
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- a/src/tools/hunspell.cxx 2022-08-02 09:18:13.525748669 +0100
|
||||
+++ b/src/tools/hunspell.cxx 2022-08-02 09:18:38.598006933 +0100
|
||||
@@ -581,7 +581,7 @@
|
||||
#ifdef HAVE_CURSES_H
|
||||
char* scanline(char* message) {
|
||||
char input[INPUTLEN];
|
||||
- printw(message);
|
||||
+ printw("%s", message);
|
||||
echo();
|
||||
getnstr(input, INPUTLEN);
|
||||
noecho();
|
||||
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
Name: hunspell
|
||||
Summary: A spell checker and morphological analyzer library
|
||||
Version: 1.7.0
|
||||
Release: 21%{?dist}
|
||||
Source: https://github.com/hunspell/hunspell/archive/v%{version}.tar.gz
|
||||
Version: 1.7.2
|
||||
Release: 10%{?dist}
|
||||
Source: https://github.com/hunspell/hunspell/releases/download/v%{version}/hunspell-%{version}.tar.gz
|
||||
URL: https://github.com/hunspell/hunspell
|
||||
License: LGPLv2+ or GPLv2+ or MPLv1.1
|
||||
License: LGPL-2.1-or-later OR GPL-2.0-or-later OR MPL-1.1
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: autoconf, automake, libtool, ncurses-devel, gettext-devel
|
||||
BuildRequires: perl-generators
|
||||
|
|
@ -20,8 +20,7 @@ BuildRequires: make
|
|||
Requires: hunspell-en-US
|
||||
Requires: hunspell-filesystem = %{version}-%{release}
|
||||
|
||||
Patch0: 0001-invalid-read-memory-access-624.patch
|
||||
Patch1: Werror-format-security.patch
|
||||
Patch0: 0001-Resolves-rhbz-2158548-allow-longer-words-for-hunspel.patch
|
||||
|
||||
%description
|
||||
Hunspell is a spell checker and morphological analyzer library and program
|
||||
|
|
@ -45,8 +44,7 @@ packages.
|
|||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1 -b .CVE-2019-16707
|
||||
%patch1 -p1 -b .Werror-format-security
|
||||
%patch -P0 -p1 -b .rhbz2158548
|
||||
|
||||
%build
|
||||
autoreconf -vfi
|
||||
|
|
@ -81,7 +79,6 @@ make distclean
|
|||
%{profileuse} %configure $configureflags
|
||||
%make_build
|
||||
%endif
|
||||
cd po && %make_build update-gmo && cd ..
|
||||
|
||||
%check
|
||||
%ifarch %{ix86} x86_64
|
||||
|
|
@ -132,6 +129,39 @@ mkdir $RPM_BUILD_ROOT/%{_datadir}/myspell
|
|||
%{_datadir}/myspell
|
||||
|
||||
%changelog
|
||||
* Thu Jul 24 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.2-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||
|
||||
* Fri Jan 17 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.2-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||
|
||||
* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.2-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
|
||||
|
||||
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.2-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Sat Jan 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.2-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.2-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Wed Feb 22 2023 Caolán McNamara <caolanm@redhat.com> - 1.7.2-4
|
||||
- migrated to SPDX license
|
||||
|
||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.2-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Fri Jan 06 2023 Caolán McNamara <caolanm@redhat.com> - 1.7.2-2
|
||||
- Resolves: rhbz#2158548 get hunspell-ko working again
|
||||
|
||||
* Fri Dec 30 2022 Caolán McNamara <caolanm@redhat.com> - 1.7.2-1
|
||||
- Resolves: rhbz#2157049 latest release
|
||||
|
||||
* Mon Aug 22 2022 Caolán McNamara <caolanm@redhat.com> - 1.7.1-1
|
||||
- latest release
|
||||
|
||||
* Tue Aug 02 2022 Caolán McNamara <caolanm@redhat.com> - 1.7.0-21
|
||||
- Resolves: rhbz#2113444 FTBFS
|
||||
|
||||
|
|
|
|||
5
plans/hunspell.fmf
Normal file
5
plans/hunspell.fmf
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
summary: Basic smoke test
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (v1.7.0.tar.gz) = 8149b2e8b703a0610c9ca5160c2dfad3cf3b85b16b3f0f5cfcb7ebb802473b2d499e8e2d0a637a97a37a24d62424e82d3880809210d3f043fa17a4970d47c903
|
||||
SHA512 (hunspell-1.7.2.tar.gz) = 49b3619bff12e111b6cc3f3d9463612b116f9b2a976896718e65f5bc4a83ece11100aaf56a4d18127ea39107446c495e12affe5ff3c9159ae8aba70e512f44ac
|
||||
|
|
|
|||
4
tests/data.txt
Normal file
4
tests/data.txt
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Cloud
|
||||
Linux
|
||||
Fedora
|
||||
Fedoraaa
|
||||
5
tests/main.fmf
Normal file
5
tests/main.fmf
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
require:
|
||||
- hunspell
|
||||
- hunspell-de
|
||||
test: bash ./run_tests.sh
|
||||
framework: shell
|
||||
58
tests/run_tests.sh
Normal file
58
tests/run_tests.sh
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#!/bin/bash
|
||||
|
||||
check_pkg() {
|
||||
local pkg=$1
|
||||
if rpm -q $pkg
|
||||
then
|
||||
echo "PASS"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
}
|
||||
|
||||
check_dict() {
|
||||
if [ -f "/usr/share/hunspell/de_DE.dic" ]
|
||||
then
|
||||
echo "PASS"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
}
|
||||
|
||||
check_misspelled_word() {
|
||||
VAR1="Fedoraaa"
|
||||
VAR2=$(hunspell -l data.txt)
|
||||
if [ "$VAR1" = "$VAR2" ]; then
|
||||
echo "PASS"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
}
|
||||
|
||||
check_misspelled_line() {
|
||||
VAR1="Fedoraaa"
|
||||
VAR2=$(hunspell -L data.txt)
|
||||
if [ "$VAR1" = "$VAR2" ]; then
|
||||
echo "PASS"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
}
|
||||
|
||||
check_correct_word() {
|
||||
VAR1="Cloud\nLinux\nFedora"
|
||||
VAR1=$(echo -e "$VAR1")
|
||||
VAR2=$(hunspell -G data.txt)
|
||||
if [ "$VAR1" = "$VAR2" ]; then
|
||||
echo "PASS"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
}
|
||||
|
||||
check_pkg "hunspell"
|
||||
check_pkg "hunspell-de"
|
||||
check_dict
|
||||
check_misspelled_word
|
||||
check_misspelled_line
|
||||
check_correct_word
|
||||
Loading…
Add table
Add a link
Reference in a new issue