Crash with empty dictionary

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Crash with empty dictionary
Date: 2007-08-21 18:46:01
Message-ID: 46CB32E9.1040109@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I'm fooling around with tsearch, and bumped into a segfault, when using
a custom ispell dictionary with DictFile pointing to an empty file.
NISortDictionary assumes there's at least one word in the dictionary,
and crashes on line 941:

> Conf->AffixData[1] = pstrdup(Conf->Spell[0]->p.flag);

I'm not sure if this is a sane way to set up a dictionary, but surely
seg faulting is not the right thing to do. Should we throw an error on
an empty dict file, or should we swallow it without crashing?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-08-21 19:18:13 Re: A couple of tsearch loose ends
Previous Message Teodor Sigaev 2007-08-21 18:30:32 Re: A couple of tsearch loose ends