agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Jeff Davis <jdavis@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: dict_synonym.c: remove incorrect outlen.
Date: Mon, 08 Jun 2026 18:54:15 +0000
Message-ID: <E1wWf71-001dTK-20@gemulon.postgresql.org> (raw)

dict_synonym.c: remove incorrect outlen.

Previously, outlen was miscalculated if case_sensitive was false and
str_tolower() changed the byte length of the string. If outlen was too
large, pnstrdup() would stop at the NUL terminator, preventing
overrun. But if outlen was too small, it would cause truncation.

Fix by just removing outlen. It was only used in a single site, which
could just as well use pstrdup().

Discussion: https://postgre.es/m/1101e1a3afbbabb503317069c40374b82e6f4cac.camel@j-davis.com
Reviewed-by: Tristan Partin <tristan@partin.io>
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9234e333711ef9875a4cef31889e88439421c396

Modified Files
--------------
src/backend/tsearch/dict_synonym.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1wWf71-001dTK-20@gemulon.postgresql.org>
Permalink:  ../E1wWf71-001dTK-20@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wWf71-001dTK-20@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: jdavis@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: dict_synonym.c: remove incorrect outlen.
  In-Reply-To: <E1wWf71-001dTK-20@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