Skip to content

Commit 55d5ff8

Browse files
committed
Fix detection of short tar files, broken by commit 14ea893
Report by Noah Misch
1 parent 2e54d88 commit 55d5ff8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,10 +2034,13 @@ _discoverArchiveFormat(ArchiveHandle *AH)
20342034
exit_horribly(modulename, "input file appears to be a text format dump. Please use psql.\n");
20352035
}
20362036

2037-
if (AH->lookaheadLen != 512 && feof(fh))
2038-
exit_horribly(modulename, "input file does not appear to be a valid archive (too short?)\n");
2039-
else
2040-
READ_ERROR_EXIT(fh);
2037+
if (AH->lookaheadLen != 512)
2038+
{
2039+
if (feof(fh))
2040+
exit_horribly(modulename, "input file does not appear to be a valid archive (too short?)\n");
2041+
else
2042+
READ_ERROR_EXIT(fh);
2043+
}
20412044

20422045
if (!isValidTarHeader(AH->lookahead))
20432046
exit_horribly(modulename, "input file does not appear to be a valid archive\n");

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