Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 48da2b8

Browse files
committed
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).
1 parent 5cdd65f commit 48da2b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/interfaces/libpq/fe-connect.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,8 @@ connectFailureMessage(PGconn *conn, int errorno)
10311031
strcpy(host_addr, "???");
10321032

10331033
display_host_addr = (conn->pghostaddr == NULL) &&
1034-
(strcmp(conn->pghost, host_addr) != 0);
1034+
(conn->pghost != NULL) &&
1035+
(strcmp(conn->pghost, host_addr) != 0);
10351036

10361037
appendPQExpBuffer(&conn->errorMessage,
10371038
libpq_gettext("could not connect to server: %s\n"

0 commit comments

Comments
 (0)