Resolves: rhbz#554876 fix suggestmgr crash

This commit is contained in:
Caolan McNamara 2010-01-18 09:43:10 +00:00
parent dcde4c8eef
commit 978c4503f1
2 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,25 @@
diff -ru hunspell-1.2.8.orig/src/hunspell/suggestmgr.cxx hunspell-1.2.8/src/hunspell/suggestmgr.cxx
--- hunspell-1.2.8.orig/src/hunspell/suggestmgr.cxx 2010-01-18 09:25:59.000000000 +0000
+++ hunspell-1.2.8/src/hunspell/suggestmgr.cxx 2010-01-18 09:34:58.000000000 +0000
@@ -1742,11 +1742,10 @@
if (ns < 2) break;
}
} else {
- char t[MAXSWUTF8L];
- l1 = strlen(s1);
l2 = strlen(s2);
if (l2 == 0) return 0;
- strcpy(t, s2);
+ l1 = strlen(s1);
+ char *t = mystrdup(s2);
if (opt & NGRAM_LOWERING) mkallsmall(t, csconv);
for (int j = 1; j <= n; j++) {
ns = 0;
@@ -1759,6 +1758,7 @@
nscore = nscore + ns;
if (ns < 2) break;
}
+ free(t);
}
ns = 0;

View File

@ -1,7 +1,7 @@
Name: hunspell
Summary: A spell checker and morphological analyzer library
Version: 1.2.8
Release: 15%{?dist}
Release: 16%{?dist}
Source0: http://downloads.sourceforge.net/%{name}/hunspell-%{version}.tar.gz
Source1: http://people.debian.org/~agmartin/misc/ispellaff2myspell
Source2: http://people.redhat.com/caolanm/hunspell/wordlist2hunspell
@ -15,6 +15,7 @@ Patch2: hunspell-1.2.8-2784983.defaultlanguage.patch
Patch3: hunspell-1.2.8-2812045.warnings.fortify.patch
Patch4: hunspell-1.2.8-2826164.fixtests.patch
Patch5: hunspell-1.2.8-2910695.nohome.patch
Patch6: hunspell-1.2.8-2934195.suggestmgr.patch
%description
Hunspell is a spell checker and morphological analyzer library and program
@ -37,6 +38,7 @@ Includes and definitions for developing with hunspell
%patch3 -p1 -b .warnings.fortify.patch
%patch4 -p1 -b .fixtests.patch
%patch5 -p1 -b .nohome.patch
%patch6 -p1 -b .suggestmgr.patch
# Filter unwanted Requires for the "use explicitely" string in ispellaff2myspell
cat << \EOF > %{name}-req
#!/bin/sh
@ -127,6 +129,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man3/hunspell.3.gz
%changelog
* Mon Jan 18 2010 Caolan McNamara <caolanm@redhat.com> - 1.2.8-16
- Resolves: rhbz#554876 fix suggestmgr crash
* Tue Jan 05 2010 Caolan McNamara <caolanm@redhat.com> - 1.2.8-15
- Remove bad const warnings