summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2007-04-02 15:24:20 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2007-04-02 15:24:20 +0000
commit8ac98594f1aabd86387c61c068430051174a39e5 (patch)
tree3fe66757e0747c9b1ec8375de730b53aa6fb66ce
parent51d80a455cf8112e0c9c5c7f8750bd5744f275a5 (diff)
Since the kernel allows argv[0] == NULL, dont core in ld.so
diff from Matthew Dempsky, with reminder from theo.
-rw-r--r--libexec/ld.so/loader.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c
index 777d127ca19..7f9fada42ed 100644
--- a/libexec/ld.so/loader.c
+++ b/libexec/ld.so/loader.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: loader.c,v 1.109 2007/01/28 21:28:23 drahn Exp $ */
+/* $OpenBSD: loader.c,v 1.110 2007/04/02 15:24:19 drahn Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -412,7 +412,7 @@ _dl_boot(const char **argv, char **envp, const long loff, long *dl_data)
phdp = (Elf_Phdr *)dl_data[AUX_phdr];
for (loop = 0; loop < dl_data[AUX_phnum]; loop++) {
if (phdp->p_type == PT_DYNAMIC) {
- exe_obj = _dl_finalize_object(argv[0],
+ exe_obj = _dl_finalize_object(argv[0] ? argv[0] : "",
(Elf_Dyn *)phdp->p_vaddr, dl_data, OBJTYPE_EXE,
0, 0);
_dl_add_object(exe_obj);