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:
parent
1c3fd85c94
commit
770f232a67
3 changed files with 15 additions and 8 deletions
|
@ -194,8 +194,6 @@ char shell_make_argv(size_t *argc, const char **argv, char *cmd, uint8_t max_arg
|
|||
quote = make_argv(&cmd, c);
|
||||
} while (true);
|
||||
|
||||
argv[*argc] = 0;
|
||||
|
||||
return quote;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue