gzip: fix error handling in unxz

The result of fstat() was not checked.  Furthermore, there was a
redundant check of st.st_size.  Fix both.

Reported by:    Coverity
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Eric van Gyzen 2022-02-24 17:00:52 -06:00
parent d0f4e583bf
commit 58135fbd8b

View file

@ -260,8 +260,7 @@ parse_indexes(xz_file_info *xfi, int src_fd)
{
struct stat st;
fstat(src_fd, &st);
if (st.st_size <= 0) {
if (fstat(src_fd, &st) != 0) {
return true;
}