mirror of
https://github.com/postgres/postgres.git
synced 2026-04-22 06:37:06 -04:00
Fix crash caused by NULL lookup when reporting IP address of failed
libpq connection, per report from Magnus. This happens only on GIT master and only on Win32 because that is the platform where "" maps to an IP address (localhost).
This commit is contained in:
parent
5cdd65f324
commit
48da2b87e3
1 changed files with 2 additions and 1 deletions
|
|
@ -1031,7 +1031,8 @@ connectFailureMessage(PGconn *conn, int errorno)
|
|||
strcpy(host_addr, "???");
|
||||
|
||||
display_host_addr = (conn->pghostaddr == NULL) &&
|
||||
(strcmp(conn->pghost, host_addr) != 0);
|
||||
(conn->pghost != NULL) &&
|
||||
(strcmp(conn->pghost, host_addr) != 0);
|
||||
|
||||
appendPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext("could not connect to server: %s\n"
|
||||
|
|
|
|||
Loading…
Reference in a new issue