Fix memory-safety bugs in the ispell/hunspell dictionary loader.

Allocate CompoundAffix with room for its terminator, initialize the
old-format flag buffer before NIAddAffix(), and reject incomplete or
missing Hunspell AF aliases.  None of these errors would be likely to
trigger on real dictionary files, accounting for the lack of previous
reports; but they're certainly bugs.

Bug: #19595
Reported-by: Michael Malis <[email protected]>
Author: Andrey Rachitskiy <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0fb88979bf43859c65cdf6731bfab31532bd7161

Modified Files
--------------
src/backend/tsearch/spell.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)

Reply via email to