shell_exec expects a string that is null-terminated but if line passed to strncpy is equal or bigger than the buffer it will not produce a null-terminated command. Jira: ZEP-2474 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds the following tests: help tests: shell_exec(help): 0 shell_exec(help dummy): 0 shell_exec(help invalid): -22 select tests: shell_exec(select): 0 shell_exec(select dummy): 0 shell_exec(select invalid): -22 module tests: shell_exec(dummy cmd1): 0 shell_exec(dummy cmd1 arg1): -22 shell_exec(dummy cmd2 arg1): 0 shell_exec(dummy cmd2 arg1 arg2): -22 shell_exec(dummy cmd3 arg1 arg2): 0 shell_exec(dummy cmd3 arg1 arg2 arg3): -22 shell_exec(dummy cmd4 arg1 arg2 arg3): -22 shell_exec(cmd1): 0 shell_exec(cmd1 arg1): -22 shell_exec(cmd2 arg1): 0 shell_exec(cmd2 arg1 arg2): -22 shell_exec(cmd3 arg1 arg2): 0 shell_exec(cmd3 arg1 arg2 arg3): -22 shell_exec(cmd4 arg1 arg2 arg3): -22 app handler tests: shell_exec(cmd4 arg1 arg2 arg3): 0 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>