Improve ispell dictionary's defenses against bad affix files.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 94de3a679bf0afe9bb15ffb7af066b7df58859af
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2014-10-23T17:11:41Z
Releases: 9.1.15
Improve ispell dictionary's defenses against bad affix files.

Don't crash if an ispell dictionary definition contains flags but not
any compound affixes.  (This isn't a security issue since only superusers
can install affix files, but still it's a bad thing.)

Also, be more careful about detecting whether an affix-file FLAG command
is old-format (ispell) or new-format (myspell/hunspell).  And change the
error message about mixed old-format and new-format commands into something
intelligible.

Per bug #11770 from Emre Hasegeli.  Back-patch to all supported branches.

Files

PathChange+/−
src/backend/tsearch/spell.c modified +44 −26