summaryrefslogtreecommitdiff
path: root/p7zip/CVE-2017-17969.patch
blob: 9a820af730675d4762273d488d0e83c692bcd6c4 (plain)
    1 From: =?utf-8?q?Antoine_Beaupr=C3=A9?= <anarcat@debian.org>
    2 Date: Sun, 28 Jan 2018 21:19:50 +0100
    3 Subject: backport of the CVE-2017-17969 fix from 7zip 18.00-beta
    4 
    5 ---
    6  CPP/7zip/Compress/ShrinkDecoder.cpp | 7 ++++++-
    7  1 file changed, 6 insertions(+), 1 deletion(-)
    8 
    9 diff --git a/CPP/7zip/Compress/ShrinkDecoder.cpp b/CPP/7zip/Compress/ShrinkDecoder.cpp
   10 index 80b7e67..4acdce5 100644
   11 --- a/CPP/7zip/Compress/ShrinkDecoder.cpp
   12 +++ b/CPP/7zip/Compress/ShrinkDecoder.cpp
   13 @@ -121,7 +121,12 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *
   14      {
   15        _stack[i++] = _suffixes[cur];
   16        cur = _parents[cur];
   17 -    }
   18 +      if (i >= kNumItems)
   19 +        break;
   20 +     }
   21 +
   22 +    if (i >= kNumItems)
   23 +      break;
   24      
   25      _stack[i++] = (Byte)cur;
   26      lastChar2 = (Byte)cur;

Generated by cgit