[PATCH rtems-tools v1 3/4] record-filter-zlib.cc: Initialize stream_'s fields

Ryan Long ryan.long at oarcorp.com
Wed Sep 1 20:00:05 UTC 2021


CID 1503020: Uninitialized pointer field

Closes #4434
---
 trace/record/record-filter-zlib.cc | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/trace/record/record-filter-zlib.cc b/trace/record/record-filter-zlib.cc
index 87b2cfe..62f1171 100644
--- a/trace/record/record-filter-zlib.cc
+++ b/trace/record/record-filter-zlib.cc
@@ -35,6 +35,19 @@
 
 ZlibFilter::ZlibFilter() : buffer_(65536)
 {
+  stream_.next_in   = nullptr;
+  stream_.avail_in  = 0;
+  stream_.total_in  = 0;
+  stream_.next_out  = nullptr;
+  stream_.avail_out = 0;
+  stream_.total_out = 0;
+  stream_.msg       = nullptr;
+  stream_.zalloc    = nullptr;
+  stream_.zfree     = nullptr;
+  stream_.opaque    = nullptr;
+  stream_.data_type = 0;
+  stream_.adler     = 0;
+  stream_.reserved  = 0;
   inflateInit(&stream_);
 }
 
-- 
1.8.3.1



More information about the devel mailing list