postgresql/src/backend/tsearch
Tom Lane e2921c0e9d Clear errno before calling strtol() in spell.c.
Per POSIX, a caller of strtol() that wishes to check for errors must
set errno to 0 beforehand.  Several places in spell.c neglected that,
so that they risked delivering a false overflow error in case errno
had been ERANGE already.  Given the lack of field reports, this case
may be unreachable at present --- but it's surely trouble waiting to
happen, so fix it.

Author: Jacob Brazeal <jacob.brazeal@gmail.com>
Discussion: https://postgr.es/m/CA+COZaBhsq6EromFm+knMJfzK6nTpG23zJ+K2=nfUQQXcj_xcQ@mail.gmail.com
Backpatch-through: 13
2025-03-08 11:24:52 -05:00
..
dicts Update copyright for 2019 2019-01-02 12:44:25 -05:00
dict.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
dict_ispell.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
dict_simple.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
dict_synonym.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
dict_thesaurus.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
Makefile Update copyright for 2022 2022-01-07 19:04:57 -05:00
regis.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
spell.c Clear errno before calling strtol() in spell.c. 2025-03-08 11:24:52 -05: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 Fix t_isspace(), etc., when datlocprovider=i and datctype=C. 2023-03-17 12:07:47 -07: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 2022 2022-01-07 19:04:57 -05:00
ts_typanalyze.c Invent qsort_interruptible(). 2022-07-12 16:30:36 -04:00
ts_utils.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
wparser.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
wparser_def.c Check for interrupts and stack overflow in TParserGet(). 2023-06-24 17:18:08 -04:00