From 4b2ca146fa13b97b357ea058dcccb3245efde460 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Jun 22 2015 06:00:56 +0000 Subject: fix #1201630 - fix recursion in JPEG magic pattern --- diff --git a/file-5.22-jpeg.patch b/file-5.22-jpeg.patch new file mode 100644 index 0000000..fd9e8bf --- /dev/null +++ b/file-5.22-jpeg.patch @@ -0,0 +1,42 @@ +From 9f0601f3c03ffc561a2638c35eaf24308c7b3a72 Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Fri, 2 Jan 2015 22:40:27 +0000 +Subject: [PATCH] Explain recursion better and avoid double recursion in the + masked entries + +--- + magic/Magdir/jpeg | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/magic/Magdir/jpeg b/magic/Magdir/jpeg +index f32f58a..588073f 100644 +--- a/magic/Magdir/jpeg ++++ b/magic/Magdir/jpeg +@@ -41,7 +41,8 @@ + # This uses recursion... + 0 name jpeg_segment + >0 beshort 0xFFFE +->>(2.S+2) use jpeg_segment ++# Recursion handled by FFE0 ++#>>(2.S+2) use jpeg_segment + >>2 pstring/HJ x \b, comment: "%s" + + >0 beshort 0xFFC0 +@@ -70,6 +71,7 @@ + >>(2.S+2) use jpeg_segment + + >0 beshort 0xFFE1 ++# Recursion handled by FFE0 + #>>(2.S+2) use jpeg_segment + >>4 string Exif \b, Exif Standard: [ + >>>10 indirect/r x +@@ -85,7 +87,8 @@ + # D9: End of image + # Dn: Restart + >0 beshort&0xFFD0 =0xFFD0 +->>(2.S+2) use jpeg_segment ++>>0 beshort&0xFFE0 !0xFFE0 ++>>>(2.S+2) use jpeg_segment + + #>0 beshort x unknown 0x%x + #>>(2.S+2) use jpeg_segment diff --git a/file.spec b/file.spec index d795f3a..97fb9ad 100644 --- a/file.spec +++ b/file.spec @@ -4,7 +4,7 @@ Summary: A utility for determining file types Name: file Version: 5.22 -Release: 3%{?dist} +Release: 4%{?dist} License: BSD Group: Applications/File Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz @@ -22,6 +22,7 @@ Patch14: file-5.19-cafebabe.patch Patch15: file-5.22-awk-perl.patch Patch16: file-5.22-zlib.patch Patch17: file-5.22-symlink.patch +Patch18: file-5.22-jpeg.patch URL: http://www.darwinsys.com/file/ Requires: file-libs = %{version}-%{release} BuildRequires: zlib-devel @@ -94,6 +95,7 @@ file(1) command. %patch15 -p1 %patch16 -p1 %patch17 -p1 +%patch18 -p1 # Patches can generate *.orig files, which can't stay in the magic dir, # otherwise there will be problems with compiling magic file! @@ -202,6 +204,9 @@ cd %{py3dir} %endif %changelog +* Mon Jun 22 2015 Jan Kaluza - 5.22-4 +- fix #1201630 - fix recursion in JPEG magic pattern + * Wed Apr 29 2015 Jan Kaluza - 5.22-3 - restore previous symbolic link detection behaviour (#1207945)