From 8bffc40b3a6b62ae993123c5fc16e9e2c5800ad8 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 20 Jan 2010 14:27:57 +0000 Subject: [PATCH] 2010-01-20 Chris Johns Coverity Id 9 * libmisc/shell/main_ls.c: Modify conditional to avoid NULL dereference. --- cpukit/ChangeLog | 6 ++++++ cpukit/libmisc/shell/main_ls.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index f5c25c6dde..ae2c38edb5 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2010-01-20 Chris Johns + + Coverity Id 9 + * libmisc/shell/main_ls.c: Modify conditional to avoid NULL + dereference. + 2010-01-19 Joel Sherrill Coverity Id 10 diff --git a/cpukit/libmisc/shell/main_ls.c b/cpukit/libmisc/shell/main_ls.c index ace56411de..f1cbbcfc91 100644 --- a/cpukit/libmisc/shell/main_ls.c +++ b/cpukit/libmisc/shell/main_ls.c @@ -627,7 +627,7 @@ display(rtems_shell_ls_globals* globals, FTSENT *p, FTSENT *list) np->group = &np->data[ulen + 1]; (void)strcpy(np->group, group); - if (f_flags) { + if (f_flags && flags) { np->flags = &np->data[ulen + glen + 2]; (void)strcpy(np->flags, flags); }