If we change obj_rtld.path after initialising __progname, make sure we

change __progname to point at the new storage otherwise it ends up
pointing at freed memory which leads to confusing garbled error messages.
This commit is contained in:
Doug Rabson 2004-03-29 18:37:37 +00:00
parent 181e65db5b
commit f88e6caca2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=127579

View File

@ -323,6 +323,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
strcmp(obj_main->interp, obj_rtld.path) != 0) {
free(obj_rtld.path);
obj_rtld.path = xstrdup(obj_main->interp);
__progname = obj_rtld.path;
}
digest_dynamic(obj_main, 0);