Skip to content

Commit a6fefc8

Browse files
committed
Check number of affixes to prevent core dump with zero number of affixes
1 parent 9ce51f3 commit a6fefc8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contrib/tsearch2/ispell/spell.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,9 @@ NISortAffixes(IspellDict * Conf)
719719
CMPDAffix *ptr;
720720
int firstsuffix = -1;
721721

722+
if (Conf->naffixes==0)
723+
return;
724+
722725
if (Conf->naffixes > 1)
723726
qsort((void *) Conf->Affix, Conf->naffixes, sizeof(AFFIX), cmpaffix);
724727

0 commit comments

Comments
 (0)