Fix uninitalized memory use in deflate_stream

Reference in original zlib:
https://github.com/madler/zlib/pull/393

Resolves: #1586

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
Damian Jarek committed 2019-05-04 17:30:23 +02:00
1 parent 16631de5d9
commit 7a388b7da6
3 files changed
+2 -5

No files matched your search

@@ -623,6 +623,7 @@ init()
window_ = reinterpret_cast<Byte*>(buf_.get());
prev_ = reinterpret_cast<std::uint16_t*>(buf_.get() + nwindow);
std::memset(prev_, 0, nprev);
head_ = reinterpret_cast<std::uint16_t*>(buf_.get() + nwindow + nprev);
/* We overlay pending_buf_ and d_buf_ + l_buf_. This works