postgresql/src/backend/tsearch
Tom Lane 52a676ef4f 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 Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
dict_ispell.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
dict_simple.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
dict_synonym.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
dict_thesaurus.c Clean up newlines following left parentheses 2020-01-30 13:42:14 -03:00
Makefile Update copyrights for 2020 2020-01-01 12:21:45 -05:00
regis.c Update copyrights for 2020 2020-01-01 12:21:45 -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 Update copyrights for 2020 2020-01-01 12:21:45 -05:00
ts_typanalyze.c Move src/backend/utils/hash/hashfn.c to src/common 2020-02-27 09:25:41 +05:30
ts_utils.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
wparser.c Remove useless pfree()s at the ends of various ValuePerCall SRFs. 2020-03-16 21:36:53 -04:00
wparser_def.c Check for interrupts and stack overflow in TParserGet(). 2023-06-24 17:18:08 -04:00