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

Started by Tom Lane4 months ago1 messagescommitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

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 <michaelmalis2@gmail.com>
Author: Andrey Rachitskiy <pl0h0yp1@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: /messages/by-id/19595-7dc18b4e212c4757@postgresql.org
Backpatch-through: 14

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/444038bb78d5d5f950e9f9bd5166c4f79bc3d4c0

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