Re: Text search segmentation fault - Mailing list pgsql-general

From Grzegorz Jaśkiewicz
Subject Re: Text search segmentation fault
Date
Msg-id 2f4958ff0901290709o1b1695e3l4ef455f2fdcbbc7e@mail.gmail.com
Whole thread Raw
In response to Re: Text search segmentation fault  (Tommy Gildseth <tommy.gildseth@usit.uio.no>)
Responses Re: Text search segmentation fault  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-general
if it's
static uint32
makeCompoundFlags(IspellDict *Conf, int affix)
{
        uint32          flag = 0;
        char       *str = Conf->AffixData[affix];

        while (str && *str)
        {
                flag |= Conf->flagval[(unsigned int) *str];
                str++;
        }

        return (flag & FF_DICTFLAGMASK);
}


Than I have quite few notes about that function:
- affix is not checked on entry, and should be unsigned,
- for sake of safety uint32_t should be used instead of unsigned int,
in the cast
- there should be some safety limit for lenght of str,

pgsql-general by date:

Previous
From: Igor Katson
Date:
Subject: Re: Text search name and name synonims dictionary
Next
From: Tom Lane
Date:
Subject: Re: Encoding problem using pg_dumpall