From 7db88227feb3121c7025159c4557be646123018c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Tue, 6 Feb 2018 11:36:46 +0000 Subject: [PATCH] Improve security patch --- ...E-2017-17969.patch => CVE-2017-17969.patch | 26 +++++++++---------- p7zip.spec | 7 +++-- 2 files changed, 18 insertions(+), 15 deletions(-) rename 13-CVE-2017-17969.patch => CVE-2017-17969.patch (50%) diff --git a/13-CVE-2017-17969.patch b/CVE-2017-17969.patch similarity index 50% rename from 13-CVE-2017-17969.patch rename to CVE-2017-17969.patch index 9a820af..ebc0ac9 100644 --- a/13-CVE-2017-17969.patch +++ b/CVE-2017-17969.patch @@ -1,26 +1,26 @@ -From: =?utf-8?q?Antoine_Beaupr=C3=A9?= -Date: Sun, 28 Jan 2018 21:19:50 +0100 -Subject: backport of the CVE-2017-17969 fix from 7zip 18.00-beta +From 79bca880ce7bcf07216c45f93afea545e0344418 Mon Sep 17 00:00:00 2001 +From: aone +Date: Mon, 5 Feb 2018 13:01:09 +0100 +Subject: [PATCH] Security fix CVE-2017-17969 --- - CPP/7zip/Compress/ShrinkDecoder.cpp | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) + CPP/7zip/Compress/ShrinkDecoder.cpp | 5 +++++ + 1 file changed, 5 insertions(+) diff --git a/CPP/7zip/Compress/ShrinkDecoder.cpp b/CPP/7zip/Compress/ShrinkDecoder.cpp -index 80b7e67..4acdce5 100644 +index 80b7e67..5bb0559 100644 --- a/CPP/7zip/Compress/ShrinkDecoder.cpp +++ b/CPP/7zip/Compress/ShrinkDecoder.cpp @@ -121,7 +121,12 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * { _stack[i++] = _suffixes[cur]; cur = _parents[cur]; -- } -+ if (i >= kNumItems) -+ break; -+ } -+ -+ if (i >= kNumItems) -+ break; ++ if (cur >= kNumItems || i >= kNumItems) ++ break; + } ++ ++ if (cur >= kNumItems || i >= kNumItems) ++ break; _stack[i++] = (Byte)cur; lastChar2 = (Byte)cur; diff --git a/p7zip.spec b/p7zip.spec index d6377f2..c917a96 100644 --- a/p7zip.spec +++ b/p7zip.spec @@ -7,7 +7,7 @@ Summary: Very high compression ratio file archiver Name: p7zip Version: 16.02 -Release: 9%{?dist} +Release: 10%{?dist} # Files under C/Compress/Lzma/ are dual LGPL or CPL License: LGPLv2 and (LGPLv2+ or CPL) URL: http://p7zip.sourceforge.net/ @@ -26,7 +26,7 @@ Patch4: p7zip-manpages.patch Patch5: 02-man.patch Patch6: CVE-2016-9296.patch Patch7: 05-hardening-flags.patch -Patch10: 13-CVE-2017-17969.patch +Patch10: CVE-2017-17969.patch Patch11: 14-Fix-g++-warning.patch BuildRequires: cmake @@ -171,6 +171,9 @@ make test %changelog +* Tue Feb 06 2018 Sérgio Basto - 16.02-10 +- Improve security patch + * Sat Jan 27 2018 Sérgio Basto - 16.02-9 - Security fix for CVE-2017-17969 (from Debian) - Add 05-hardening-flags.patch, 09-man-update.patch, 10-drop-fm-doc.patch