]> git.saurik.com Git - wxWidgets.git/commitdiff
make sure we don't use uninitalized output stream in OnSysWrite() (coverity checked...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 7 Mar 2006 23:38:09 +0000 (23:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 7 Mar 2006 23:38:09 +0000 (23:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/zstream.cpp

index 684ff82cfde0791bfe85c8f7a15bbb7b8ae86497..ab71f710f80497dd2855b88551a6d357639fb6f2 100644 (file)
@@ -283,7 +283,11 @@ size_t wxZlibOutputStream::OnSysWrite(const void *buffer, size_t size)
   wxASSERT_MSG(m_deflate && m_z_buffer, wxT("Deflate stream not open"));
 
   if (!m_deflate || !m_z_buffer)
   wxASSERT_MSG(m_deflate && m_z_buffer, wxT("Deflate stream not open"));
 
   if (!m_deflate || !m_z_buffer)
+  {
     m_lasterror = wxSTREAM_WRITE_ERROR;
     m_lasterror = wxSTREAM_WRITE_ERROR;
+    return 0;
+  }
+
   if (!IsOk() || !size)
     return 0;
 
   if (!IsOk() || !size)
     return 0;