postgres.git / summary / log / commit / refs
commit a6fefc866c4bf484127e91260044449dc2ae1ae0
Author: Teodor Sigaev <teodor@sigaev.ru>
Date: Mon Feb 06 15:45:34 2006 +0000
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 d702dbd9cca..69c91470f67 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);
[parent: 9ce51f3aa661]