libmisc/shell: Check the shell command pointers when adding a command

This commit is contained in:
Chris Johns
2021-08-21 12:49:36 +10:00
parent 4dc81f65c7
commit 8f3973fe8d

View File

@@ -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.