agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix overflows with ts_headline()
Date: Mon, 11 May 2026 12:19:37 +0000
Message-ID: <E1wMPbl-0002Tn-07@gemulon.postgresql.org> (raw)

Fix overflows with ts_headline()

The options "StartSel", "StopSel" and "FragmentDelimiter" given by a
caller of the SQL function ts_headline() have their lengths stored as
int16.  When providing values larger than PG_INT16_MAX, it was possible
to overflow the length values stored, leading to incorrect behaviors in
generateHeadline(), in most cases translating to a crash.

Attempting to use values for these options larger than PG_INT16_MAX is
now blocked.  Some test cases are added to cover our tracks.

Reported-by: Xint Code
Author: Michael Paquier <michael@paquier.xyz>
Backpatch-through: 14
Security: CVE-2026-6473

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/62ad262661ed92b0fbd43e8b7bbd1e0e38cbb9c0
Author: Michael Paquier <michael@paquier.xyz>

Modified Files
--------------
src/backend/tsearch/wparser_def.c     | 24 +++++++++++++++++++++---
src/test/regress/expected/tsearch.out | 10 ++++++++++
src/test/regress/sql/tsearch.sql      |  8 ++++++++
3 files changed, 39 insertions(+), 3 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1wMPbl-0002Tn-07@gemulon.postgresql.org>
Permalink:  ../E1wMPbl-0002Tn-07@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wMPbl-0002Tn-07@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: noah@leadboat.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix overflows with ts_headline()
  In-Reply-To: <E1wMPbl-0002Tn-07@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox