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

Back-patch to all supported branches.
REL8_4_STABLE
Heikki Linnakangas 13 years ago
parent 697f5cadf5
commit f835b71750
  1. 3
      src/bin/pg_dump/pg_backup_db.c

@ -255,7 +255,8 @@ ConnectDatabase(Archive *AHX,
/* check to see that the backend connection was successfully made */
if (PQstatus(AH->connection) == CONNECTION_BAD)
die_horribly(AH, 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_database_version(AH);

Loading…
Cancel
Save