pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <jdavis@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: ltree/crc32.c: fix fragile code.
Date: Mon, 24 Aug 2026 20:58:56 +0000
Message-ID: <E1wybkt-00000001x9L-26Tp@gemulon.postgresql.org> (raw)

ltree/crc32.c: fix fragile code.

Explicitly make space for the NUL when casefolding.

No known bug in the previous code, because the previous buffer (size
12) was more than large enough for folding any codepoint with enough
room left for a NUL. The builtin provider's limit is 7; ICU's limit
seems to be 7 also; and libc always does 1:1 mappings so the real
limit is MAX_MULTIBYTE_CHAR_LEN + 1 (size 5).

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Rithvika Devisetti <devisettirithvika@gmail.com>
Discussion: https://postgr.es/m/2cfbc37ae8deccd3825e36b7f31c391cbf8ff9b8.camel@j-davis.com
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8fa803dd695073a6fad49c49878b46783ac2f207

Modified Files
--------------
contrib/ltree/crc32.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)



view thread (3+ messages)

Message-ID: <E1wybkt-00000001x9L-26Tp@gemulon.postgresql.org>
Permalink:  ../E1wybkt-00000001x9L-26Tp@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wybkt-00000001x9L-26Tp@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: ltree/crc32.c: fix fragile code.
  In-Reply-To: <E1wybkt-00000001x9L-26Tp@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