public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Ayush Tiwari <[email protected]>
Cc: [email protected]
Cc: [email protected]
Subject: Re: BUG #19525: In `contrib/dict_int`, handling a token whose first byte is a null byte causes `pnstrdup()` .
Date: Sun, 05 Jul 2026 16:12:06 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAJTYsWW7+aVAFFV3dxg1s-RrtwioYPj1qQ9o2oAM40MReTXzAg@mail.gmail.com>
References: <[email protected]>
<CAJTYsWW7+aVAFFV3dxg1s-RrtwioYPj1qQ9o2oAM40MReTXzAg@mail.gmail.com>
Ayush Tiwari <[email protected]> writes:
> On Thu, 18 Jun 2026 at 18:54, PG Bug reporting form <[email protected]>
> wrote:
>> -- 3. Create a C helper (raw_lexize.so) that invokes the lexize callback
>> with
>> -- a raw bytea token, bypassing the text encoding layer.
>> CREATE FUNCTION raw_lexize(dict regdictionary, token bytea)
>> RETURNS text[] AS 'raw_lexize', 'raw_lexize' LANGUAGE C STRICT;
> Your analysis seems right to me.
It is not. I do not think this is a bug; if it is a bug we have got
probably hundreds of places that'd have to be fixed. The general rule
in Postgres is that we do not permit embedded nulls in text values.
The fact that a misguided superuser can break that rule doesn't make
it a bug for code to depend on it. (There are approximately an
infinite number of ways for a misguided superuser to break Postgres,
just as the root user can destroy a Unix system many times over.)
So I see no value in this proposed change in dintdict_lexize.
But the one in dxsyn_lexize seems worthwhile, just because
it makes that code shorter, simpler, and faster. Since that's
mostly an example module, I don't feel a need to back-patch,
but I'll go commit that to HEAD.
regards, tom lane
view thread (4+ 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], [email protected], [email protected]
Subject: Re: BUG #19525: In `contrib/dict_int`, handling a token whose first byte is a null byte causes `pnstrdup()` .
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