termux-packages/packages/p7zip/2-CVE-2017-17969.patch

19 lines
576 B
Diff
Raw Normal View History

2019-03-06 15:48:28 +01:00
diff -Nur p7zip/CPP/7zip/Compress/ShrinkDecoder.cpp CVE-2017-17969_mod/CPP/7zip/Compress/ShrinkDecoder.cpp
--- p7zip/CPP/7zip/Compress/ShrinkDecoder.cpp 2016-05-19 01:31:02.000000000 +0800
+++ CVE-2017-17969_mod/CPP/7zip/Compress/ShrinkDecoder.cpp 2019-03-06 22:04:10.675224841 +0800
@@ -121,8 +121,13 @@
{
_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;