diff options
author | peter <peter@FreeBSD.org> | 1999-04-04 06:01:09 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-04-04 06:01:09 +0000 |
commit | d352c9407063818d7ca027fe7d37282636d7fd71 (patch) | |
tree | 9bbf4913d594b001b9d81507d0d3cefabeb037b1 /libexec | |
parent | df68fc891ee0312e07a22bce08ce1dbceab3cc8c (diff) | |
download | FreeBSD-src-d352c9407063818d7ca027fe7d37282636d7fd71.zip FreeBSD-src-d352c9407063818d7ca027fe7d37282636d7fd71.tar.gz |
If somebody does an execv("foo", NULL) (which theoretically is an error),
avoid crashing inside rtld (since it's easy) since everything else handles
it. Of course, if the target program checks argv[], it'll fall over.
Reviewed by: jdp
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/rtld-elf/rtld.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 11b2214..837819c 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: rtld.c,v 1.14 1999/03/24 23:37:35 nate Exp $ + * $Id: rtld.c,v 1.15 1999/03/24 23:47:29 nate Exp $ */ /* @@ -260,7 +260,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) obj_main = digest_phdr(phdr, phnum, entry); } - obj_main->path = xstrdup(argv[0]); + obj_main->path = xstrdup(argv[0] ? argv[0] : "(null)"); obj_main->mainprog = true; digest_dynamic(obj_main); |