[PATCH] TraceWriterQEMU.cc: Initialize header._pad

Ryan Long ryan.long at oarcorp.com
Wed Sep 1 18:52:24 UTC 2021


CID 1506204: Uninitialized scalar variable

Closes #4488
---
 tester/covoar/TraceWriterQEMU.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tester/covoar/TraceWriterQEMU.cc b/tester/covoar/TraceWriterQEMU.cc
index c417745..cc849b6 100644
--- a/tester/covoar/TraceWriterQEMU.cc
+++ b/tester/covoar/TraceWriterQEMU.cc
@@ -113,6 +113,7 @@ namespace Trace {
     header.big_endian = false;
     header.machine[0] = 0; // XXX ??
     header.machine[1] = 0; // XXX ??
+    header._pad = 0;
     status = ::fwrite( &header, sizeof(trace_header), 1, traceFile );
     if (status != 1) {
       std::cerr << "Unable to write header to " << file << std::endl;
-- 
1.8.3.1



More information about the devel mailing list