agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid unsafe access to negative index in a TupleDesc.
Date: Mon, 06 Apr 2026 18:22:44 +0000
Message-ID: <E1w9oax-003Gzv-2O@gemulon.postgresql.org> (raw)
Avoid unsafe access to negative index in a TupleDesc.
Commit aa606b931 installed a test that would reference a nonexistent
TupleDesc array entry if a system column is used in COPY FROM WHERE.
Typically this would be harmless, but with bad luck it could result
in a phony "generated columns are not supported in COPY FROM WHERE
conditions" error, and at least in principle it could cause SIGSEGV.
(Compare 570e2fcc0 which fixed the identical problem in another
place.) Also, since c98ad086a it throws an Assert instead.
In the back branches, just guard the test to make it a safe no-op for
system columns. Commit 21c69dc73 installed a more aggressive answer
in master.
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/6f435023-8ab6-47c2-ba07-035d0c4212f9@gmail.com
Backpatch-through: 14-18
Branch
------
REL_15_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/07e833e3cff3da136980c7a4e30e965f825ae83c
Modified Files
--------------
src/backend/commands/copy.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
view thread (5+ messages) latest in thread
Message-ID: <E1w9oax-003Gzv-2O@gemulon.postgresql.org>
Permalink: ../E1w9oax-003Gzv-2O@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1w9oax-003Gzv-2O@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: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Avoid unsafe access to negative index in a TupleDesc.
In-Reply-To: <E1w9oax-003Gzv-2O@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