mirror of
https://github.com/postgres/postgres.git
synced 2025-04-21 12:05:57 +03:00
Fix detection of short tar files, broken by commit 14ea89366fe321609afc5838ff9fe2ded1cd707d
Report by Noah Misch
This commit is contained in:
parent
2e54d88af1
commit
55d5ff825f
@ -2034,10 +2034,13 @@ _discoverArchiveFormat(ArchiveHandle *AH)
|
|||||||
exit_horribly(modulename, "input file appears to be a text format dump. Please use psql.\n");
|
exit_horribly(modulename, "input file appears to be a text format dump. Please use psql.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AH->lookaheadLen != 512 && feof(fh))
|
if (AH->lookaheadLen != 512)
|
||||||
exit_horribly(modulename, "input file does not appear to be a valid archive (too short?)\n");
|
{
|
||||||
else
|
if (feof(fh))
|
||||||
READ_ERROR_EXIT(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))
|
if (!isValidTarHeader(AH->lookahead))
|
||||||
exit_horribly(modulename, "input file does not appear to be a valid archive\n");
|
exit_horribly(modulename, "input file does not appear to be a valid archive\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user