0002-CVE-2017-17969.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From: =?utf-8?q?Antoine_Beaupr=C3=A9?= <anarcat@debian.org>
  2. Date: Fri, 2 Feb 2018 11:11:41 +0100
  3. Subject: Heap-based buffer overflow in 7zip/Compress/ShrinkDecoder.cpp
  4. Origin: vendor, https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/27d7/attachment/CVE-2017-17969.patch
  5. Forwarded: https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/#27d7
  6. Bug: https://sourceforge.net/p/p7zip/bugs/204/
  7. Bug-Debian: https://bugs.debian.org/888297
  8. Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-17969
  9. Reviewed-by: Salvatore Bonaccorso <carnil@debian.org>
  10. Last-Update: 2018-02-01
  11. Applied-Upstream: 18.00-beta
  12. Signed-off-by: André Hentschel <nerv@dawncrow.de>
  13. ---
  14. CPP/7zip/Compress/ShrinkDecoder.cpp | 7 ++++++-
  15. 1 file changed, 6 insertions(+), 1 deletion(-)
  16. diff --git a/CPP/7zip/Compress/ShrinkDecoder.cpp b/CPP/7zip/Compress/ShrinkDecoder.cpp
  17. index 80b7e67..ca37764 100644
  18. --- a/CPP/7zip/Compress/ShrinkDecoder.cpp
  19. +++ b/CPP/7zip/Compress/ShrinkDecoder.cpp
  20. @@ -121,8 +121,13 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *
  21. {
  22. _stack[i++] = _suffixes[cur];
  23. cur = _parents[cur];
  24. + if (cur >= kNumItems || i >= kNumItems)
  25. + break;
  26. }
  27. -
  28. +
  29. + if (cur >= kNumItems || i >= kNumItems)
  30. + break;
  31. +
  32. _stack[i++] = (Byte)cur;
  33. lastChar2 = (Byte)cur;