Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#4491 closed defect (fixed)

TraceWriterQEMU.cc: Buffer not null terminated issue spotted by Coverity

Reported by: Ryan Long Owned by: Ryan Long <ryan.long@…>
Priority: normal Milestone: 6.1
Component: tool Version: 6
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

CID 1506207: Buffer not null terminated

   CID 1506207 (#1 of 1): Buffer not null terminated (BUFFER_SIZE)3. 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) );

Change History (1)

comment:1 Changed on 09/27/21 at 22:18:21 by Ryan Long <ryan.long@…>

Owner: set to Ryan Long <ryan.long@…>
Resolution: fixed
Status: newclosed

In [changeset:"a06f48a6cd5567e6e173f275127dbaa26da7cfcb/rtems-tools" a06f48a/rtems-tools]:

TraceWriterQEMU.cc: Change strncpy to memcpy

CID 1506207: Buffer not null terminated

Closes #4491

Note: See TracTickets for help on using tickets.