Re: Potential buffer overrun in spell.c's CheckAffix() - Mailing list pgsql-bugs

From Andrey Borodin
Subject Re: Potential buffer overrun in spell.c's CheckAffix()
Date
Msg-id 2480A4C7-E144-474F-B4DD-D9D798526E6E@yandex-team.ru
Whole thread
In response to Re: Potential buffer overrun in spell.c's CheckAffix()  (Andrey Borodin <x4mmm@yandex-team.ru>)
List pgsql-bugs

> On 23 Apr 2026, at 12:58, Andrey Borodin <x4mmm@yandex-team.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.


pgsql-bugs by date:

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