Skip to content

Commit 2930c05

Browse files
committed
Don't pass NULL to fprintf, if a bogus connection string is given to pg_dump.
Back-patch to all supported branches.
1 parent 5d6899d commit 2930c05

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/pg_dump/pg_backup_db.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ ConnectDatabase(Archive *AHX,
300300
/* check to see that the backend connection was successfully made */
301301
if (PQstatus(AH->connection) == CONNECTION_BAD)
302302
exit_horribly(modulename, "connection to database \"%s\" failed: %s",
303-
PQdb(AH->connection), PQerrorMessage(AH->connection));
303+
PQdb(AH->connection) ? PQdb(AH->connection) : "",
304+
PQerrorMessage(AH->connection));
304305

305306
/* check for version mismatch */
306307
_check_database_version(AH);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy