[PATCH 0/5] Fix Dereference before null check errors

Ryan Long thisisryanlong at gmail.com
Thu Feb 18 14:35:08 UTC 2021


Hi,

I fixed these "Dereference before null check errors in Coverity. I
didn't have to add anything to most of these files. I mainly just had to
move the assignment of the pointers being flagged to after their
corresponding check. In shell.c, I added an _Assert() to ensure that the
pointer wasn't null before being passed to fileno().

Thanks,
Ryan

Ryan Long (5):
  b1553brm.c: Fix Dereference before null check (CID #1399829)
  b1553rt.c: Fix Deference before null check (CID #1399830)
  grtc.c: Fix Dereference before null check (CID #1399840)
  grspw_pkt.c: Fix Dereference before null check (CID #1399846)
  shell.c: Fix Dereference before null check (CID #1467420)

 bsps/shared/grlib/1553/b1553brm.c | 7 +++++--
 bsps/shared/grlib/1553/b1553rt.c  | 4 +++-
 bsps/shared/grlib/spw/grspw_pkt.c | 4 +++-
 bsps/shared/grlib/tmtc/grtc.c     | 4 +++-
 cpukit/libmisc/shell/shell.c      | 5 ++++-
 5 files changed, 18 insertions(+), 6 deletions(-)

-- 
1.8.3.1



More information about the devel mailing list