summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2003-05-30 03:14:13 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2003-05-30 03:14:13 +0000
commitb4c032ea084cbb173fef4fd3cb4ff860ab92cda1 (patch)
treea6436090bc443ff9e867fc770240adec3afde608
parent6cb420f95789cfbaef9617285a433c8b56e170f4 (diff)
Fix botch in tag array indexing. deal with 0 - DT_NUM,
DT_LOPROC - DT_LOPROC+DT_PROCNUM, and no other values.
-rw-r--r--libexec/ld.so/loader.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c
index 820488c56e0..0bcf1285d21 100644
--- a/libexec/ld.so/loader.c
+++ b/libexec/ld.so/loader.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: loader.c,v 1.57 2003/05/30 01:33:05 drahn Exp $ */
+/* $OpenBSD: loader.c,v 1.58 2003/05/30 03:14:12 drahn Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -456,10 +456,11 @@ _dl_boot_bind(const long sp, long *dl_data)
dynp = (Elf_Dyn *)((long)_DYNAMIC + loff);
#endif
while (dynp != NULL && dynp->d_tag != DT_NULL) {
- if (dynp->d_tag < DT_LOPROC)
+ if (dynp->d_tag < DT_NUM)
dynld.Dyn.info[dynp->d_tag] = dynp->d_un.d_val;
- else if (dynp->d_tag >= DT_LOPROC && dynp->d_tag < DT_LOPROC + DT_NUM)
- dynld.Dyn.info[dynp->d_tag + DT_NUM - DT_LOPROC] =
+ else if (dynp->d_tag >= DT_LOPROC &&
+ dynp->d_tag < DT_LOPROC + DT_PROCNUM)
+ dynld.Dyn.info[dynp->d_tag - DT_LOPROC + DT_NUM] =
dynp->d_un.d_val;
if (dynp->d_tag == DT_TEXTREL)
dynld.dyn.textrel = 1;