Re: Potential buffer overrun in spell.c's CheckAffix()

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Potential buffer overrun in spell.c's CheckAffix()
Date: 2026-04-30 07:56:17
Message-ID: 2480A4C7-E144-474F-B4DD-D9D798526E6E@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> On 23 Apr 2026, at 12:58, Andrey Borodin <x4mmm(at)yandex-team(dot)ru> wrote:
>
> Yes, 40Kb in NIImportOOAffixes() is a lot. But is it important in grand scheme of
> things? Minimum max_stack_depth is 100Kb, ought to be enough…

IsAffixFlagInUse(), addCompoundAffixFlagValue() and getCompoundAffixFlagValue()
also allocate 8Kb on stack...
Would it make sense to add check_stack_depth() into addCompoundAffixFlagValue()?
Other prominent allocators (NIImportOOAffixes(),NIImportAffixes()) call it anyway.
At least we will know if disaster is around the corner.

Best regards, Andrey Borodin.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrey Borodin 2026-04-30 12:03:29 Re: BUG #19458: OOM killer in jsonb_path_exists_opr (@?) with malformed JSONPath containing non-existent variables
Previous Message Masahiko Sawada 2026-04-29 16:11:32 Re: TRAP: failed Assert("offsets[i] > offsets[i - 1]"), File: "tidstore.c"