pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Check for interrupts and stack overflow in TParserGet().
Date: Sat, 24 Jun 2023 21:18:25 +0000
Message-ID: <E1qDAeH-000FLY-5B@gemulon.postgresql.org> (raw)

Check for interrupts and stack overflow in TParserGet().

TParserGet() recurses for some token types, meaning it's possible
to drive it to stack overflow.  Since this is a minority behavior,
I chose to add the check_stack_depth() call to the two places that
recurse rather than doing it during every single call.

While at it, add CHECK_FOR_INTERRUPTS(), because this can run
unpleasantly long for long inputs.

Per bug #17995 from Zuming Jiang.  This is old, so back-patch
to all supported branches.

Discussion: https://postgr.es/m/17995-9f20ff3e6389db4c@postgresql.org

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4c61afa47c618a11ad78b91dcd083e73b6332e82

Modified Files
--------------
src/backend/tsearch/wparser_def.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)



view thread (12+ messages)  latest in thread

Message-ID: <E1qDAeH-000FLY-5B@gemulon.postgresql.org>
Permalink:  ../E1qDAeH-000FLY-5B@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qDAeH-000FLY-5B@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: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Check for interrupts and stack overflow in TParserGet().
  In-Reply-To: <E1qDAeH-000FLY-5B@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox