Skip to content

Commit

Permalink
binfmt_execmodule: If incoming envp is NULL get parent envp
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pussuw authored and xiaoxiang781216 committed Apr 21, 2022
1 parent d6ef484 commit 1a7d81c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion binfmt/binfmt_execmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1a7d81c

Please sign in to comment.