mirror of
https://github.com/apache/nuttx.git
synced 2026-05-19 03:03:37 +08:00
binfmt: Handle argv/argv[0] == NULL correctly in exec_module
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
@@ -168,8 +168,17 @@ int exec_module(FAR const struct binary_s *binp,
|
||||
|
||||
/* Initialize the task */
|
||||
|
||||
ret = nxtask_init(tcb, argv[0], binp->priority, NULL,
|
||||
binp->stacksize, binp->entrypt, &argv[1]);
|
||||
if (argv && argv[0])
|
||||
{
|
||||
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);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user