Content-Length: 263573 | pFad | http://github.com/postgrespro/postgres_cluster/commit/11003eb55658df0caf183eef69c7a97d56a4f2d7

B9 libpq: Fix inadvertent change in PQhost() behavior. · postgrespro/postgres_cluster@11003eb · GitHub
Skip to content

Commit 11003eb

Browse files
committed
libpq: Fix inadvertent change in PQhost() behavior.
Commit 274bb2b caused PQhost() to return the value of the hostaddr parameter rather than the relevant host when the latter parameter was specified. That's wrong. Commit 9a1d0af then amplified the damage by using PQhost() in more places, so that the SSL test suite started failing. Report by Andreas Karlsson; patch by me.
1 parent a01a501 commit 11003eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5736,7 +5736,8 @@ PQhost(const PGconn *conn)
57365736
{
57375737
if (!conn)
57385738
return NULL;
5739-
if (conn->connhost != NULL)
5739+
if (conn->connhost != NULL &&
5740+
conn->connhost[conn->whichhost].type != CHT_HOST_ADDRESS)
57405741
return conn->connhost[conn->whichhost].host;
57415742
else if (conn->pghost != NULL && conn->pghost[0] != '\0')
57425743
return conn->pghost;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/11003eb55658df0caf183eef69c7a97d56a4f2d7

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy