From 5d750ac8edc4b81a9d186ed5248f8c7df09e9576 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Mon, 26 Sep 2016 17:28:41 +0200 Subject: [PATCH] fixed issues reported by Klocwork --- Foundation/src/DeflatingStream.cpp | 15 +++++++++++---- Foundation/src/InflatingStream.cpp | 16 ++++++++++++---- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/Foundation/src/DeflatingStream.cpp b/Foundation/src/DeflatingStream.cpp index 1adb54fb3..56d7b9146 100644 --- a/Foundation/src/DeflatingStream.cpp +++ b/Foundation/src/DeflatingStream.cpp @@ -27,13 +27,20 @@ DeflatingStreamBuf::DeflatingStreamBuf(std::istream& istr, StreamType type, int _pOstr(0), _eof(false) { + _zstr.next_in = 0; + _zstr.avail_in = 0; + _zstr.total_in = 0; + _zstr.next_out = 0; + _zstr.avail_out = 0; + _zstr.total_out = 0; + _zstr.msg = 0; + _zstr.state = 0; _zstr.zalloc = Z_NULL; _zstr.zfree = Z_NULL; _zstr.opaque = Z_NULL; - _zstr.next_in = 0; - _zstr.avail_in = 0; - _zstr.next_out = 0; - _zstr.avail_out = 0; + _zstr.data_type = 0; + _zstr.adler = 0; + _zstr.reserved = 0; _buffer = new char[DEFLATE_BUFFER_SIZE]; diff --git a/Foundation/src/InflatingStream.cpp b/Foundation/src/InflatingStream.cpp index 77ecb500b..1eac3fa1a 100644 --- a/Foundation/src/InflatingStream.cpp +++ b/Foundation/src/InflatingStream.cpp @@ -16,6 +16,7 @@ #include "Poco/InflatingStream.h" #include "Poco/Exception.h" +#include namespace Poco { @@ -28,13 +29,20 @@ InflatingStreamBuf::InflatingStreamBuf(std::istream& istr, StreamType type): _eof(false), _check(type != STREAM_ZIP) { + _zstr.next_in = 0; + _zstr.avail_in = 0; + _zstr.total_in = 0; + _zstr.next_out = 0; + _zstr.avail_out = 0; + _zstr.total_out = 0; + _zstr.msg = 0; + _zstr.state = 0; _zstr.zalloc = Z_NULL; _zstr.zfree = Z_NULL; _zstr.opaque = Z_NULL; - _zstr.next_in = 0; - _zstr.avail_in = 0; - _zstr.next_out = 0; - _zstr.avail_out = 0; + _zstr.data_type = 0; + _zstr.adler = 0; + _zstr.reserved = 0; _buffer = new char[INFLATE_BUFFER_SIZE];