public inbox for [email protected]  
help / color / mirror / Atom feed
From: Heikki Linnakangas <[email protected]>
To: [email protected]
Subject: pgsql: Fix expanding 'bounds' in pg_trgm's calc_word_similarity() funct
Date: Fri, 20 Feb 2026 09:57:51 +0000
Message-ID: <[email protected]> (raw)

Fix expanding 'bounds' in pg_trgm's calc_word_similarity() function

If the 'bounds' array needs to be expanded, because the input contains
more trigrams than the initial guess, the code didn't return the
reallocated array correctly to the caller. That could lead to a crash
in the rare case that the input string becomes longer when it's
lower-cased. The only known instance of that is when an ICU locale is
used with certain single-byte encodings. This was an oversight in
commit 00896ddaf41f.

Author: Zsolt Parragi <[email protected]>
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/041e02e6a6110af871b909c55f1a1bd9d5a66cdb

Modified Files
--------------
contrib/pg_trgm/trgm_op.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



view thread (2+ messages)

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Fix expanding 'bounds' in pg_trgm's calc_word_similarity() funct
  In-Reply-To: <[email protected]>

* 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