Re: Text search segmentation fault

From: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
To: General Postgres Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Text search segmentation fault
Date: 2009-01-29 15:09:34
Message-ID: 2f4958ff0901290709o1b1695e3l4ef455f2fdcbbc7e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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,

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-01-29 15:16:16 Re: [GENERAL] Encoding problem using pg_dumpall
Previous Message Igor Katson 2009-01-29 15:06:51 Re: Text search name and name synonims dictionary