pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Correctly copy the target host identification in PQcancelCreate.
Date: Wed, 02 Jul 2025 19:48:15 +0000
Message-ID: <E1uX3RH-004OvK-2X@gemulon.postgresql.org> (raw)

Correctly copy the target host identification in PQcancelCreate.

PQcancelCreate failed to copy struct pg_conn_host's "type" field,
instead leaving it zero (a/k/a CHT_HOST_NAME).  This seemingly
has no great ill effects if it should have been CHT_UNIX_SOCKET
instead, but if it should have been CHT_HOST_ADDRESS then a
null-pointer dereference will occur when the cancelConn is used.

Bug: #18974
Reported-by: Maxim Boguk <maxim.boguk@gmail.com>
Author: Sergei Kornilov <sk@zsrv.org>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/18974-575f02b2168b36b3@postgresql.org
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/fe05430ace8e0b3c945cf581564458a5983a07b6

Modified Files
--------------
src/interfaces/libpq/fe-cancel.c | 1 +
1 file changed, 1 insertion(+)



view thread (3+ messages)

Message-ID: <E1uX3RH-004OvK-2X@gemulon.postgresql.org>
Permalink:  ../E1uX3RH-004OvK-2X@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uX3RH-004OvK-2X@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: Correctly copy the target host identification in PQcancelCreate.
  In-Reply-To: <E1uX3RH-004OvK-2X@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