diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b68b063..30976a3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Version 254: * Fix data race in test::stream::connect * Fix UB in websocket close tests +* Fix uninitalized memory use in deflate_stream -------------------------------------------------------------------------------- diff --git a/include/boost/beast/zlib/detail/deflate_stream.ipp b/include/boost/beast/zlib/detail/deflate_stream.ipp index 4641697c..6532662e 100644 --- a/include/boost/beast/zlib/detail/deflate_stream.ipp +++ b/include/boost/beast/zlib/detail/deflate_stream.ipp @@ -623,6 +623,7 @@ init() window_ = reinterpret_cast(buf_.get()); prev_ = reinterpret_cast(buf_.get() + nwindow); + std::memset(prev_, 0, nprev); head_ = reinterpret_cast(buf_.get() + nwindow + nprev); /* We overlay pending_buf_ and d_buf_ + l_buf_. This works diff --git a/tools/valgrind.supp b/tools/valgrind.supp index 1d1ddc0b..7c7c213f 100644 --- a/tools/valgrind.supp +++ b/tools/valgrind.supp @@ -3,11 +3,6 @@ Memcheck:Cond fun:fill_window } -{ - beast_fill_window_no_init - Memcheck:Cond - fun:_ZN5beast4zlib6detail14deflate_stream11fill_windowIvEEvRNS0_8z_paramsE -} { Ignore OpenSSL malloc Memcheck:Leak