New Defects reported by Coverity Scan for RTEMS-Tools
scan-admin at coverity.com
scan-admin at coverity.com
Wed Apr 14 17:20:52 UTC 2021
Hi,
Please find the latest report on new defect(s) introduced to RTEMS-Tools found with Coverity Scan.
2 new defect(s) introduced to RTEMS-Tools found with Coverity Scan.
3 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)
** CID 1503805: Memory - illegal accesses (BUFFER_SIZE)
/tester/covoar/TraceWriterQEMU.cc: 109 in Trace::TraceWriterQEMU::writeFile(const char *, Trace::TraceReaderBase *)()
________________________________________________________________________________________________________
*** CID 1503805: Memory - illegal accesses (BUFFER_SIZE)
/tester/covoar/TraceWriterQEMU.cc: 109 in Trace::TraceWriterQEMU::writeFile(const char *, Trace::TraceReaderBase *)()
103 return false;
104 }
105
106 //
107 // Write the Header to the file
108 //
>>> CID 1503805: Memory - illegal accesses (BUFFER_SIZE)
>>> Calling "strncpy" with a source string whose length (12 chars) is greater than or equal to the size argument (12) will fail to null-terminate "header.magic".
109 strncpy( header.magic, QEMU_TRACE_MAGIC, sizeof(header.magic) );
110 header.version = QEMU_TRACE_VERSION;
111 header.kind = QEMU_TRACE_KIND_RAW; // XXX ??
112 header.sizeof_target_pc = 32;
113 header.big_endian = false;
114 header.machine[0] = 0; // XXX ??
** CID 1503804: Memory - illegal accesses (STRING_NULL)
/tester/covoar/TraceWriterQEMU.cc: 123 in Trace::TraceWriterQEMU::writeFile(const char *, Trace::TraceReaderBase *)()
________________________________________________________________________________________________________
*** CID 1503804: Memory - illegal accesses (STRING_NULL)
/tester/covoar/TraceWriterQEMU.cc: 123 in Trace::TraceWriterQEMU::writeFile(const char *, Trace::TraceReaderBase *)()
117 if (status != 1) {
118 std::cerr << "Unable to write header to " << file << std::endl;
119 return false;
120 }
121
122 if (Verbose)
>>> CID 1503804: Memory - illegal accesses (STRING_NULL)
>>> Passing unterminated string "header.magic" to "operator <<", which expects a null-terminated string. [Note: The source code implementation of the function has been overridden by a builtin model.]
123 std::cerr << "magic = " << header.magic << std::endl
124 << "version = " << header.version << std::endl
125 << "kind = " << header.kind << std::endl
126 << "sizeof_target_pc = " << header.sizeof_target_pc << std::endl
127 << "big_endian = " << header.big_endian << std::endl
128 << std::hex << std::setfill('0')
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypUUzi-2FdSNmuyRB7BEFT8xQi8c7-2B1U0roIV5G3HXifs2odF2CS2aZ-2FK5CtfMSQ5p34-3DhP0J_EU3W9teASMK00lBXX9WT4lsogDrkCcNZLvg-2FVxwAXMoTD8gRZkwFFw9ppWwxW1-2ByMKfe63RqmHAQduXULKs0-2Fxs9cAky0JJAiHRq6rt9KvPdumlNoBAqalJMzbAnyn7NYjCrYGLF-2Fr1pxCssWW6bn4JY491OHzpsKcso1-2Bf6KUgIFxdY-2BG-2BUCkqUGxhv5ppT9TN-2Ba0B4UYjI8EvZ5updVA-3D-3D
More information about the build
mailing list