From 8f3973fe8d40a781727250b733b76d97bc091fe1 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Sat, 21 Aug 2021 12:49:36 +1000 Subject: libmisc/shell: Check the shell command pointers when adding a command --- cpukit/libmisc/shell/shell_cmdset.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cpukit') diff --git a/cpukit/libmisc/shell/shell_cmdset.c b/cpukit/libmisc/shell/shell_cmdset.c index be64b83fe4..95f180bbb5 100644 --- a/cpukit/libmisc/shell/shell_cmdset.c +++ b/cpukit/libmisc/shell/shell_cmdset.c @@ -112,6 +112,11 @@ rtems_shell_cmd_t *rtems_shell_add_cmd_struct( rtems_shell_cmd_t **next_ptr = &rtems_shell_first_cmd; rtems_shell_cmd_t *existing; + if (shell_cmd == NULL) + return NULL; + if (shell_cmd->name == NULL) + return NULL; + /* * Iterate through all commands and check if a command with this name is * already present. -- cgit v1.2.3