fix assertion failure on certain files

This commit is contained in:
Kamil Dudka 2017-02-08 09:48:41 +01:00
parent f2db2b4187
commit 20cfc7cc43
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From 5d4ec1f1279dc431343def88c95fc5315e30bffc Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Tue, 7 Feb 2017 23:21:29 +0000
Subject: [PATCH] If we are reading a sector stream that is shorter than the
minimum standard stream size, but there is no short sector chain, adjust the
dirlen.
Upstream-commit: 781a5357d0dc780e57cc36ec93e47ed3a954b74b
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
src/cdf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cdf.c b/src/cdf.c
index d38e793..b6fe6cd 100644
--- a/src/cdf.c
+++ b/src/cdf.c
@@ -527,7 +527,7 @@ cdf_read_long_sector_chain(const cdf_info_t *info, const cdf_header_t *h,
ssize_t nr;
scn->sst_tab = NULL;
scn->sst_len = cdf_count_chain(sat, sid, ss);
- scn->sst_dirlen = len;
+ scn->sst_dirlen = MAX(h->h_min_size_standard_stream, len);
scn->sst_ss = ss;
if (scn->sst_len == (size_t)-1)
--
2.7.4

View File

@ -5,7 +5,7 @@
Summary: A utility for determining file types
Name: file
Version: 5.29
Release: 2%{?dist}
Release: 3%{?dist}
License: BSD
Group: Applications/File
Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz
@ -25,6 +25,9 @@ Patch14: file-5.19-cafebabe.patch
Patch15: file-5.22-awk-perl.patch
Patch17: file-5.24-varied.patch
# picked from upstream
Patch102: file-5.29-short-sector.patch
URL: http://www.darwinsys.com/file/
Requires: file-libs = %{version}-%{release}
BuildRequires: zlib-devel
@ -97,6 +100,8 @@ file(1) command.
%patch15 -p1
%patch17 -p1
%patch102 -p1
# Patches can generate *.orig files, which can't stay in the magic dir,
# otherwise there will be problems with compiling magic file!
rm -fv magic/Magdir/*.orig
@ -203,6 +208,9 @@ cd %{py3dir}
%endif
%changelog
* Wed Feb 08 2017 Kamil Dudka <kdudka@redhat.com> - 5.29-3
- fix assertion failure on certain files (thanks to Christoph Biedl)
* Tue Dec 13 2016 Charalampos Stratakis <cstratak@redhat.com> - 5.29-2
- Rebuild for Python 3.6