Check number of affixes to prevent core dump with zero number of affixes
authorTeodor Sigaev
Mon, 6 Feb 2006 15:45:34 +0000 (15:45 +0000)
committerTeodor Sigaev
Mon, 6 Feb 2006 15:45:34 +0000 (15:45 +0000)
contrib/tsearch2/ispell/spell.c

index d702dbd9ccafeefca4378c63064cfb2010bc8f5f..69c91470f67c6c345703b7bc3e46006ada82b88e 100644 (file)
@@ -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);