binfmt_execmodule: If incoming envp is NULL get parent envp

This keeps backwards compatibility with apps that do not provide
envp. The old implementation passes NULL always and this change fixes
any regression caused by it.
This commit is contained in:
Ville Juven 2022-04-21 10:06:37 +03:00 committed by Xiang Xiao
parent d6ef4849a9
commit 1a7d81c942

View File

@ -153,7 +153,7 @@ int exec_module(FAR const struct binary_s *binp,
/* Make a copy of the environment here */
if (envp)
if (envp || (envp = get_environ_ptr()))
{
envp = binfmt_copyenv(envp);
if (!envp)