pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: emre@hasegeli.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #11770: Segfault on spell.c when there are more than one characters as suffix flag
Date: Thu, 23 Oct 2014 12:28:16 -0400
Message-ID: <5849.1414081696@sss.pgh.pa.us> (raw)
In-Reply-To: <20141023092838.2674.7830@wrigleys.postgresql.org>
References: <20141023092838.2674.7830@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

emre@hasegeli.com writes:
> How to reproduce:
> ...
> Note that the affix file is not correct without "FLAG num" which is not
> supported by PostgreSQL.  Also, the code fails to report the proper error
> on spell.c:673 when "FLAG num" is used.

Hmm.  The immediate cause of the crash is that the code is expecting some
"CompoundAffix"es to exist when usecompound = true, but they don't.
I'm not sure whether we should flag the affix file as invalid, but in
any case it'd be a good idea for CheckCompoundAffixes to defend itself
against *ptr being NULL.

As for whether the error is proper ... this code is woefully
underdocumented, but it looks to me like NIImportAffixes() is designed
to import the original ispell affix file format, and if it decides that
the file is not that but MySpell/Hunspell format then it sends control
off to NIImportOOAffixes to re-parse the whole thing.  The difficulty
is that FLAG commands exist in both formats and it's not being careful
about whether the FLAG command is new or old format.  Probably we should
insist that the FLAG argument not contain multiple letters in order to
deem it old format.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <5849.1414081696@sss.pgh.pa.us>
Permalink:  ../5849.1414081696@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5849.1414081696@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, emre@hasegeli.com
  Subject: Re: BUG #11770: Segfault on spell.c when there are more than one characters as suffix flag
  In-Reply-To: <5849.1414081696@sss.pgh.pa.us>
  References: <20141023092838.2674.7830@wrigleys.postgresql.org> <5849.1414081696@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox