From: Teodor Sigaev Date: Mon, 6 Feb 2006 15:45:34 +0000 (+0000) Subject: Check number of affixes to prevent core dump with zero number of affixes X-Git-Tag: REL8_2_BETA1~1494 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a6fefc866c4bf484127e91260044449dc2ae1ae0;p=thirdparty%2Fpostgresql.git Check number of affixes to prevent core dump with zero number of affixes --- 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);