Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

binfmt/binfmt_execmodule: Copy filename if CONFIG_BUILD_KERNEL and ar… #159

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions binfmt/binfmt_execmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ int exec_module(FAR struct binary_s *binp,
#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_BUILD_KERNEL)
FAR struct arch_addrenv_s *addrenv = &binp->addrenv->addrenv;
FAR void *vheap;
char name[CONFIG_PATH_MAX];
#endif
FAR void *stackaddr = NULL;
pid_t pid;
Expand Down Expand Up @@ -166,6 +167,13 @@ int exec_module(FAR struct binary_s *binp,
}

#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_BUILD_KERNEL)
/* If there is no argument vector, the process name must be copied here */

if (argv == NULL)
{
filename = strncpy(name, filename, CONFIG_PATH_MAX);
}

/* Instantiate the address environment containing the user heap */

ret = addrenv_select(binp->addrenv, &binp->oldenv);
Expand Down