diff options
author | Ryan Long <ryan.long@oarcorp.com> | 2021-08-11 13:43:18 -0400 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2021-09-27 17:20:47 -0500 |
commit | a06f48a6cd5567e6e173f275127dbaa26da7cfcb (patch) | |
tree | c0958b6ae415f6e9fc7eac1e697ce0ea7dd30393 /tester/covoar | |
parent | tester/mvme2307: Add support for the MVME2307 (MVME2700) BSP (diff) | |
download | rtems-tools-a06f48a6cd5567e6e173f275127dbaa26da7cfcb.tar.bz2 |
TraceWriterQEMU.cc: Change strncpy to memcpy
CID 1506207: Buffer not null terminated
Closes #4491
Diffstat (limited to 'tester/covoar')
-rw-r--r-- | tester/covoar/TraceWriterQEMU.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tester/covoar/TraceWriterQEMU.cc b/tester/covoar/TraceWriterQEMU.cc index 177b77f..0f1ea67 100644 --- a/tester/covoar/TraceWriterQEMU.cc +++ b/tester/covoar/TraceWriterQEMU.cc @@ -106,7 +106,9 @@ namespace Trace { // // Write the Header to the file // - strncpy( header.magic, QEMU_TRACE_MAGIC, sizeof(header.magic) ); + // The header.magic field is actually 12 bytes, but QEMU_TRACE_MAGIC is + // 13 bytes including the NULL. + memcpy( header.magic, QEMU_TRACE_MAGIC, sizeof(header.magic) ); header.version = QEMU_TRACE_VERSION; header.kind = QEMU_TRACE_KIND_RAW; // XXX ?? header.sizeof_target_pc = 32; |