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

From Tom Lane
Subject pgsql: Fix memory-safety bugs in the ispell/hunspell dictionary loader.
Date
Msg-id E1wqZtn-00000001Nbc-1XPL@gemulon.postgresql.org
Whole thread
List pgsql-committers
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: https://postgr.es/m/19595-7dc18b4e212c4757@postgresql.org
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5fdea3aa321b6899b5e392b7dc159809726ad7d4

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


Attachment

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Update time zone data files to tzdata release 2026c.
Next
From: David Rowley
Date:
Subject: pgsql: Fix missing MCXT_ALLOC_NO_OOM handling in MemoryContextAllocAlig