File p7zip-9.20.1-CVE-2017-17969.patch of Package p7zip.34729

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