Skip to content

Commit 4b833d0

Browse files
committed
Prevent core dump when die_horribly() is called with null AH pointer.
Problem reported and fixed by Oliver Elphick.
1 parent 4dc2bce commit 4b833d0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.65 2003/01/13 04:28:55 inoue Exp $
18+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.66 2003/01/27 00:23:38 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -1379,14 +1379,15 @@ static void
13791379
_die_horribly(ArchiveHandle *AH, const char *modulename, const char *fmt, va_list ap)
13801380
{
13811381
_write_msg(modulename, fmt, ap);
1382-
if (AH->public.verbose)
1383-
write_msg(NULL, "*** aborted because of error\n");
13841382

1385-
if (AH)
1383+
if (AH) {
1384+
if (AH->public.verbose)
1385+
write_msg(NULL, "*** aborted because of error\n");
13861386
if (AH->connection)
13871387
PQfinish(AH->connection);
1388-
if (AH->blobConnection)
1389-
PQfinish(AH->blobConnection);
1388+
if (AH->blobConnection)
1389+
PQfinish(AH->blobConnection);
1390+
}
13901391

13911392
exit(1);
13921393
}

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