#4329 closed defect (fixed)

main_rtrace.c: Dereference after null check error spotted by Coverity

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

Description

CID 1399709: Dereference after null check in rtems_trace_buffering_shell_save().

   6. var_compare_op: Comparing buf to null implies that buf might be null.
472  if (!buf)
473  {
474    close (out);
475    printf ("error: no memory\n");
476  }
477
   CID 1399709 (#1 of 1): Dereference after null check (FORWARD_NULL)7. var_deref_model: Passing null pointer buf to memset, which dereferences it.
478  memset (buf, 0, SAVE_BUF_SIZE);

Change History (1)

comment:1 Changed on 04/29/21 at 15:27:12 by Ryan Long <ryan.long@…>

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

In 8cf30c4/rtems:

main_rtrace.c: Add error return when malloc fails

CID 1399709: Dereference after null check in
rtems_trace_buffering_shell_save().

Closes #4329

Note: See TracTickets for help on using tickets.