Commit 2930c056 authored by Heikki Linnakangas's avatar Heikki Linnakangas

Don't pass NULL to fprintf, if a bogus connection string is given to pg_dump.

Back-patch to all supported branches.
parent 5d6899db
...@@ -300,7 +300,8 @@ ConnectDatabase(Archive *AHX, ...@@ -300,7 +300,8 @@ ConnectDatabase(Archive *AHX,
/* check to see that the backend connection was successfully made */ /* check to see that the backend connection was successfully made */
if (PQstatus(AH->connection) == CONNECTION_BAD) if (PQstatus(AH->connection) == CONNECTION_BAD)
exit_horribly(modulename, "connection to database \"%s\" failed: %s", exit_horribly(modulename, "connection to database \"%s\" failed: %s",
PQdb(AH->connection), PQerrorMessage(AH->connection)); PQdb(AH->connection) ? PQdb(AH->connection) : "",
PQerrorMessage(AH->connection));
/* check for version mismatch */ /* check for version mismatch */
_check_database_version(AH); _check_database_version(AH);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment