mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Fix improperly passed file descriptors
Fix for commit 14ea89366fe321609afc5838ff9fe2ded1cd707d Report by Andres Freund
This commit is contained in:
parent
0a78320057
commit
4335c95815
@ -558,15 +558,15 @@ _tarReadRaw(ArchiveHandle *AH, void *buf, size_t len, TAR_MEMBER *th, FILE *fh)
|
||||
if (th->zFH)
|
||||
{
|
||||
res = GZREAD(&((char *) buf)[used], 1, len, th->zFH);
|
||||
if (res != len && !GZEOF(fh))
|
||||
if (res != len && !GZEOF(th->zFH))
|
||||
exit_horribly(modulename,
|
||||
"could not read from input file: %s\n", strerror(errno));
|
||||
}
|
||||
else
|
||||
{
|
||||
res = fread(&((char *) buf)[used], 1, len, th->nFH);
|
||||
if (res != len && !feof(fh))
|
||||
READ_ERROR_EXIT(fh);
|
||||
if (res != len && !feof(th->nFH))
|
||||
READ_ERROR_EXIT(th->nFH);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user