postgresql/src/backend/tsearch
Tom Lane 4a81ed29d3 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
dict.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
dict_ispell.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
dict_simple.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
dict_synonym.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
dict_thesaurus.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
Makefile Update copyright for 2019 2019-01-02 12:44:25 -05:00
regis.c Update copyright for 2019 2019-01-02 12:44: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 Avoid possible dangling-pointer access in tsearch_readline_callback. 2020-09-23 11:36:13 -04: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 Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
ts_typanalyze.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
ts_utils.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
wparser.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
wparser_def.c Check for interrupts and stack overflow in TParserGet(). 2023-06-24 17:18:08 -04:00