postgresql/src/backend/tsearch
Tom Lane a2799f53d5 Limit to_tsvector_byid's initial array allocation to something sane.
The initial estimate of the number of distinct ParsedWords is just
that: an estimate.  Don't let it exceed what palloc is willing to
allocate.  If in fact we need more entries, we'll eventually fail
trying to enlarge the array.  But if we don't, this allows success on
inputs that currently draw "invalid memory alloc request size".

Per bug #18080 from Uwe Binder.  Back-patch to all supported branches.

Discussion: https://postgr.es/m/18080-d5c5e58fef8c99b7@postgresql.org
2023-09-25 11:50:28 -04:00
..
dicts Update copyright for 2019 2019-01-02 12:44:25 -05:00
Makefile Update copyright for 2021 2021-01-02 13:06:25 -05:00
dict.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
dict_ispell.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
dict_simple.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
dict_synonym.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
dict_thesaurus.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
regis.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
spell.c Defend against stack overrun in a few more places. 2022-08-24 13:01:40 -04:00
to_tsany.c Limit to_tsvector_byid's initial array allocation to something sane. 2023-09-25 11:50:28 -04:00
ts_locale.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
ts_parse.c Add comments and a missing CHECK_FOR_INTERRUPTS in ts_headline. 2022-11-21 17:07:07 -05:00
ts_selfuncs.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
ts_typanalyze.c Invent qsort_interruptible(). 2022-07-12 16:30:36 -04:00
ts_utils.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
wparser.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
wparser_def.c Check for interrupts and stack overflow in TParserGet(). 2023-06-24 17:18:08 -04:00