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.bo...@gmail.com>
Author: Sergei Kornilov <s...@zsrv.org>
Reviewed-by: Tom Lane <t...@sss.pgh.pa.us>
Discussion: https://postgr.es/m/18974-575f02b2168b3...@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(+)

Reply via email to