提交 84803b87 编写于 作者: F Fabio Erculiani 提交者: Riku Voipio

linux-user: target_argv is placed on ts->bprm->argv and can't be freed()

TaskState contains linux_bprm struct which encapsulates argv among
other things.
argv might be used around the code and is expected to contain valid
data. Before this patch, ts->bprm->argv was NULL due to it being
freed right after loader_exec().
Signed-off-by: NFabio Erculiani <lxnay@sabayon.org>
Acked-by: NAlexander Graf <agraf@suse.de>
Signed-off-by: NAlexander Graf <agraf@suse.de>
Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
上级 e0e65bee
......@@ -3486,11 +3486,6 @@ int main(int argc, char **argv, char **envp)
_exit(1);
}
for (i = 0; i < target_argc; i++) {
free(target_argv[i]);
}
free(target_argv);
for (wrk = target_environ; *wrk; wrk++) {
free(*wrk);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册