diff options
Diffstat (limited to 'import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/files')
2 files changed, 79 insertions, 0 deletions
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch new file mode 100644 index 000000000..ae2751745 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch @@ -0,0 +1,48 @@ +From b6b1782af4aa7f9084d32e4144738dc2535c8d6f Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 23 Apr 2018 23:07:21 -0700 +Subject: [PATCH] Fix narrowing errors -Wc++11-narrowing + +Clang 6.x finds these errors + + ../../../../CPP/Windows/ErrorMsg.cpp:24:10: error: case value evaluates to -2147024809, which cannot be narrowed to type 'DWORD' (aka 'unsigned int') [-Wc++11-narrowing] + case E_INVALIDARG : txt = "E_INVALIDARG"; break ; + ^ + +HRESULT causes the macro to be parsed as a signed long, so we need to force it +to be checked as an unsigned long instead. + +also reported here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224930 + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + CPP/Windows/ErrorMsg.cpp | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/CPP/Windows/ErrorMsg.cpp b/CPP/Windows/ErrorMsg.cpp +index 99684ae..78a64ba 100644 +--- a/CPP/Windows/ErrorMsg.cpp ++++ b/CPP/Windows/ErrorMsg.cpp +@@ -15,13 +15,13 @@ UString MyFormatMessage(DWORD errorCode) + + switch(errorCode) { + case ERROR_NO_MORE_FILES : txt = "No more files"; break ; +- case E_NOTIMPL : txt = "E_NOTIMPL"; break ; +- case E_NOINTERFACE : txt = "E_NOINTERFACE"; break ; +- case E_ABORT : txt = "E_ABORT"; break ; +- case E_FAIL : txt = "E_FAIL"; break ; +- case STG_E_INVALIDFUNCTION : txt = "STG_E_INVALIDFUNCTION"; break ; +- case E_OUTOFMEMORY : txt = "E_OUTOFMEMORY"; break ; +- case E_INVALIDARG : txt = "E_INVALIDARG"; break ; ++ case (DWORD) E_NOTIMPL : txt = "E_NOTIMPL"; break ; ++ case (DWORD) E_NOINTERFACE : txt = "E_NOINTERFACE"; break ; ++ case (DWORD) E_ABORT : txt = "E_ABORT"; break ; ++ case (DWORD) E_FAIL : txt = "E_FAIL"; break ; ++ case (DWORD) STG_E_INVALIDFUNCTION : txt = "STG_E_INVALIDFUNCTION"; break ; ++ case (DWORD) E_OUTOFMEMORY : txt = "E_OUTOFMEMORY"; break ; ++ case (DWORD) E_INVALIDARG : txt = "E_INVALIDARG"; break ; + case ERROR_DIRECTORY : txt = "Error Directory"; break ; + default: + txt = strerror(errorCode); diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/files/CVE-2017-17969.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/files/CVE-2017-17969.patch new file mode 100644 index 000000000..177d1455f --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/files/CVE-2017-17969.patch @@ -0,0 +1,31 @@ +p7zip: Fix CVE-2017-17969 + +[No upstream tracking] -- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=888297 + +Heap-based buffer overflow in 7zip + +Compress/ShrinkDecoder.cpp: Heap-based buffer overflow +in the NCompress::NShrink::CDecoder::CodeReal method +in 7-Zip before 18.00 and p7zip allows remote attackers +to cause a denial of service (out-of-bounds write) +or potentially execute arbitrary code via a crafted ZIP archive. + +Upstream-Status: Backport [https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/8316/attachment/CVE-2017-17969.patch] +CVE: CVE-2017-17969 +Signed-off-by: Radovan Scasny <radovan.scasny@siemens.com> + +--- a/CPP/7zip/Compress/ShrinkDecoder.cpp ++++ b/CPP/7zip/Compress/ShrinkDecoder.cpp +@@ -121,7 +121,12 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + { + _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; |