import file-5.33-21.el8

This commit is contained in:
CentOS Sources 2022-11-08 02:02:25 -05:00 committed by Stepan Oksanichenko
parent 64aeea1a60
commit b0bf89ce70
2 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,42 @@
diff --git a/src/compress.c b/src/compress.c
index cb11303..5677412 100644
--- a/src/compress.c
+++ b/src/compress.c
@@ -723,25 +723,24 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, const unsigned char *old,
rv = OKDATA;
if ((r = sread(fdp[STDOUT_FILENO][0], *newch, bytes_max, 0)) > 0)
break;
- DPRINTF("Read stdout failed %d (%s)\n", fdp[STDOUT_FILENO][0],
- r != -1 ? strerror(errno) : "no data");
-
- rv = ERRDATA;
- if (r == 0 &&
- (r = sread(fdp[STDERR_FILENO][0], *newch, bytes_max, 0)) > 0)
- {
+ if (r < 0) {
+ rv = ERRDATA;
+ DPRINTF("Read stdout failed %d (%s)\n", fdp[STDOUT_FILENO][0],
+ strerror(errno));
+ goto err;
+ } else if ((r = sread(fdp[STDERR_FILENO][0], *newch, bytes_max, 0)) > 0){
+ rv = ERRDATA;
r = filter_error(*newch, r);
break;
}
- free(*newch);
if (r == 0)
- rv = makeerror(newch, n, "Read failed, %s",
- strerror(errno));
- else
- rv = makeerror(newch, n, "No data");
+ break;
+ free(*newch);
+ rv = ERRDATA;
+ rv = makeerror(newch, n, "Read stderr failed, %s",
+ strerror(errno));
goto err;
}
-
*n = r;
/* NUL terminate, as every buffer is handled here. */
(*newch)[*n] = '\0';

View File

@ -15,7 +15,7 @@
Summary: A utility for determining file types
Name: file
Version: 5.33
Release: 20%{?dist}
Release: 21%{?dist}
License: BSD
Group: Applications/File
Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz
@ -85,6 +85,9 @@ Patch21: file-5.33-other-languages.patch
# fix heap-based buffer overflow in cdf_read_property_info() (CVE-2019-18218)
Patch22: file-5.37-CVE-2019-18218.patch
# not yet upstream (#2095828)
Patch23: file-5.33-fix-compression.patch
URL: http://www.darwinsys.com/file/
Requires: file-libs = %{version}-%{release}
BuildRequires: zlib-devel
@ -255,6 +258,9 @@ cd %{py3dir}
%endif
%changelog
* Wed Aug 17 2022 Vincent Mihalkovic <vmihalko@redhat.com> - 5.33-21
- fix recognition (src/compress.c) of compressed empty files (#2095828)
* Tue May 04 2021 Vincent Mihalkovic <vmihalko@redhat.com> - 5.33-20
- rebuild (#1954434)