From 10793ebfbb49d48e6a97f8e2d02081f458bd80b4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 7 Mar 2006 23:38:09 +0000 Subject: [PATCH] make sure we don't use uninitalized output stream in OnSysWrite() (coverity checked CID 7) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/zstream.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/zstream.cpp b/src/common/zstream.cpp index 684ff82cfd..ab71f710f8 100644 --- a/src/common/zstream.cpp +++ b/src/common/zstream.cpp @@ -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) + { m_lasterror = wxSTREAM_WRITE_ERROR; + return 0; + } + if (!IsOk() || !size) return 0;