Check number of affixes to prevent core dump with zero number of affixes

This commit is contained in:
Teodor Sigaev 2006-02-06 15:45:34 +00:00
parent 9ce51f3aa6
commit a6fefc866c
1 changed files with 3 additions and 0 deletions

View 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);