Re: Fix for fragile code in ltree/crc32.c

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fix for fragile code in ltree/crc32.c
Date: 2026-08-19 07:44:36
Message-ID: d42bb121-d126-4834-b034-3de3d320cf1c@iki.fi
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 19/08/2026 03:05, Jeff Davis wrote:
> The buffer in ltree_crc32_sz() is more than large enough in practice,
> but it didn't explicitly leave room for the NUL byte. Patch attached.

Makes sense.

Looking at pg_strfold() (and other similar functions), there's no
indication that there's an upper bound on the destination size like
this. Does UNICODE_CASEMAP_BUFSZ work for all collation providers and
locales? How about adding a comment in pg_strfold() and friends about that?
- Heikki

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-08-19 07:45:46 Re: [PATCH] Add tests for src/backend/nodes/extensible.c
Previous Message jian he 2026-08-19 07:34:55 Re: Row pattern recognition