File CVE-2021-3465.patch of Package p7zip.19425

Index: p7zip_16.02/CPP/7zip/Common/StreamObjects.cpp
===================================================================
--- p7zip_16.02.orig/CPP/7zip/Common/StreamObjects.cpp
+++ p7zip_16.02/CPP/7zip/Common/StreamObjects.cpp
@@ -157,6 +157,8 @@ STDMETHODIMP CDynBufSeqOutStream::Write(
 
 STDMETHODIMP CBufPtrSeqOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
 {
+  if(_buffer == nullptr || _size == _pos)
+    return E_FAIL;
   size_t rem = _size - _pos;
   if (rem > size)
     rem = (size_t)size;
openSUSE Build Service is sponsored by