binfmt: Handle argv/argv[0] == NULL correctly in exec_module
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
2e49e1bc5c
commit
34f31ff3f8
@ -168,8 +168,17 @@ int exec_module(FAR const struct binary_s *binp,
|
|||||||
|
|
||||||
/* Initialize the task */
|
/* Initialize the task */
|
||||||
|
|
||||||
ret = nxtask_init(tcb, argv[0], binp->priority, NULL,
|
if (argv && argv[0])
|
||||||
binp->stacksize, binp->entrypt, &argv[1]);
|
{
|
||||||
|
ret = nxtask_init(tcb, argv[0], binp->priority, NULL,
|
||||||
|
binp->stacksize, binp->entrypt, &argv[1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ret = nxtask_init(tcb, filename, binp->priority, NULL,
|
||||||
|
binp->stacksize, binp->entrypt, argv);
|
||||||
|
}
|
||||||
|
|
||||||
binfmt_freeargv(argv);
|
binfmt_freeargv(argv);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user