pgsql: Tighten up tsqueryrecv().

Поиск
Список
Период
Сортировка
Искать

pgsql: Tighten up tsqueryrecv().

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Tighten up tsqueryrecv().

tsqueryrecv() accepted zero-length lexemes, which tsqueryin() doesn't.
It also accepted phrase distance values larger than MAXENTRYPOS,
which tsqueryin() doesn't.  While neither of these omissions are
very harmful in themselves, they do allow accepting tsquery values
that will fail in a subsequent textual dump/reload.

Commit 23d9ad771 performed similar tightening of tsvectorrecv(),
but I left off these changes at the time because they didn't seem
to have security implications.

Reported-by: Claude Code (via Noah Misch)
Author: Tom Lane 
Reviewed-by: Chao Li 
Discussion: https://postgr.es/m/455079.1786897319@sss.pgh.pa.us
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/91989795d2876c5105171226eb1fd24eabe97504

Modified Files
--------------
src/backend/utils/adt/tsquery.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

FAQ