shell: Fix case when too many arguments are provided

Shell was accepting CONFIG_SHELL_ARGC_MAX+1 arguments which lead to
memory corruption and fault. Added error message reported when number
of provided arguments exceeds CONFIG_SHELL_ARGC_MAX.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2020-09-11 09:54:12 +02:00 committed by Carles Cufí
commit 770f232a67
3 changed files with 15 additions and 8 deletions

View file

@ -62,8 +62,6 @@ config SHELL_ARGC_MAX
default 12
help
Maximum number of arguments that can build a command.
If command is composed of more than defined, argument SHELL_ARGC_MAX
and following are passed as one argument in the string.
config SHELL_WILDCARD
bool "Enable wildcard support in shell"