Commit 55d5ff82 authored by Bruce Momjian's avatar Bruce Momjian

Fix detection of short tar files, broken by commit 14ea8936

Report by Noah Misch
parent 2e54d88a
......@@ -2034,10 +2034,13 @@ _discoverArchiveFormat(ArchiveHandle *AH)
exit_horribly(modulename, "input file appears to be a text format dump. Please use psql.\n");
}
if (AH->lookaheadLen != 512 && feof(fh))
exit_horribly(modulename, "input file does not appear to be a valid archive (too short?)\n");
else
READ_ERROR_EXIT(fh);
if (AH->lookaheadLen != 512)
{
if (feof(fh))
exit_horribly(modulename, "input file does not appear to be a valid archive (too short?)\n");
else
READ_ERROR_EXIT(fh);
}
if (!isValidTarHeader(AH->lookahead))
exit_horribly(modulename, "input file does not appear to be a valid archive\n");
......
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