pgsql: ecpg: fix more minor mishandling of bad input in preprocessor.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: ecpg: fix more minor mishandling of bad input in preprocessor.
Date: 2024-10-17 19:28:39
Message-ID: E1t1WAp-001HHN-Uf@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

ecpg: fix more minor mishandling of bad input in preprocessor.

Don't get confused by an unmatched right brace in the input.
(Previously, this led to discarding information about file-level
variables and then possibly crashing.)

Detect, rather than crash on, an attempt to index into a non-array
variable.

As before, in the absence of field complaints I'm not too
excited about back-patching these.

Per valgrind testing by Alexander Lakhin.

Discussion: https://postgr.es/m/a239aec2-6c79-5fc9-9272-cea41158a360@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1fed234f9faf1071d925434c5e9c14688fb4c77e

Modified Files
--------------
src/interfaces/ecpg/preproc/ecpg.trailer | 13 ++++++++-----
src/interfaces/ecpg/preproc/variable.c | 3 ++-
2 files changed, 10 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2024-10-17 21:59:28 pgsql: Improve ThrowErrorData() comments for use with soft errors.
Previous Message Thomas Munro 2024-10-17 09:34:48 pgsql: Fix extreme skew detection in Parallel Hash Join.