File p7zip-16.02-CVE-2017-17969.patch of Package p7zip

Index: p7zip_16.02/CPP/7zip/Compress/ShrinkDecoder.cpp
===================================================================
--- p7zip_16.02.orig/CPP/7zip/Compress/ShrinkDecoder.cpp
+++ p7zip_16.02/CPP/7zip/Compress/ShrinkDecoder.cpp
@@ -121,7 +121,12 @@ HRESULT CDecoder::CodeReal(ISequentialIn
     {
       _stack[i++] = _suffixes[cur];
       cur = _parents[cur];
+      if (cur >= kNumItems || i >= kNumItems)
+        break;
     }
+
+    if (cur >= kNumItems || i >= kNumItems)
+      break;
     
     _stack[i++] = (Byte)cur;
     lastChar2 = (Byte)cur;
openSUSE Build Service is sponsored by