#4254 closed defect (fixed)

shell.c: Dereference before null check error spotted by Coverity

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

Description

CID 1467420: Dereference before null check in rtems_shell_line_editor().

322  int          in_fileno = fileno(in);
   deref_ptr_in_call: Dereferencing pointer out.
323  int          out_fileno = fileno(out);
324
325  /*
326   * Only this task can use this file descriptor because calling
327   * fileno will block if another thread call made a call on this
328   * descriptor.
329   */
   CID 1467420 (#1 of 1): Dereference before null check (REVERSE_INULL)check_after_deref: Null-checking out suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
330  output = (out && isatty(in_fileno));

Change History (1)

comment:1 Changed on 02/18/21 at 19:39:33 by Ryan Long <thisisryanlong@…>

Owner: set to Ryan Long <thisisryanlong@…>
Resolution: fixed
Status: newclosed

In fa25b73/rtems:

shell.c: Fix Dereference before null check (CID #1467420)

CID 1467420: Dereference before null check in rtems_shell_line_editor().

Closes #4254

Note: See TracTickets for help on using tickets.