From a6fefc866c4bf484127e91260044449dc2ae1ae0 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Mon, 6 Feb 2006 15:45:34 +0000 Subject: [PATCH] Check number of affixes to prevent core dump with zero number of affixes --- contrib/tsearch2/ispell/spell.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/tsearch2/ispell/spell.c b/contrib/tsearch2/ispell/spell.c index d702dbd9cc..69c91470f6 100644 --- a/contrib/tsearch2/ispell/spell.c +++ b/contrib/tsearch2/ispell/spell.c @@ -719,6 +719,9 @@ NISortAffixes(IspellDict * Conf) CMPDAffix *ptr; int firstsuffix = -1; + if (Conf->naffixes==0) + return; + if (Conf->naffixes > 1) qsort((void *) Conf->Affix, Conf->naffixes, sizeof(AFFIX), cmpaffix); -- 2.11.0