summaryrefslogtreecommitdiffstats
path: root/usr.bin/symorder/symorder.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-01-21 10:24:18 +0000
committerbde <bde@FreeBSD.org>1995-01-21 10:24:18 +0000
commitac917deba6f02a0a2454c21059de306c3fc248f1 (patch)
tree56f560fda3980b6f8a0a3f7281ff7b45d34c9418 /usr.bin/symorder/symorder.c
parent3da24c0fb2e48446a2d7d087ccff7d7d2fc4d681 (diff)
downloadFreeBSD-src-ac917deba6f02a0a2454c21059de306c3fc248f1.zip
FreeBSD-src-ac917deba6f02a0a2454c21059de306c3fc248f1.tar.gz
Use exactly the same checks in excluded() as in inlist(): ignore stabs and
stringless symbols in excluded(); check for too-small (nonzero) string table offsets in inlist().
Diffstat (limited to 'usr.bin/symorder/symorder.c')
-rw-r--r--usr.bin/symorder/symorder.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/symorder/symorder.c b/usr.bin/symorder/symorder.c
index f2f4ef2..3644312 100644
--- a/usr.bin/symorder/symorder.c
+++ b/usr.bin/symorder/symorder.c
@@ -267,14 +267,10 @@ inlist(p)
register char *nam;
register struct nlist *op;
- if (p->n_type & N_STAB)
+ if (p->n_type & N_STAB || p->n_un.n_strx == 0)
return (-1);
- if (p->n_un.n_strx == 0)
- return (-1);
-
- if (p->n_un.n_strx >= strtabsize)
+ if (p->n_un.n_strx < sizeof(int) || p->n_un.n_strx >= strtabsize)
badfmt("corrupted symbol table");
-
nam = &strings[p->n_un.n_strx - sizeof(int)];
for (op = &order[nsym]; --op >= order; ) {
if (strcmp(op->n_un.n_name, nam) != 0)
@@ -291,6 +287,8 @@ excluded(p)
register char *nam;
register int x;
+ if (p->n_type & N_STAB || p->n_un.n_strx == 0)
+ return (0);
if (p->n_un.n_strx < sizeof(int) || p->n_un.n_strx >= strtabsize)
badfmt("corrupted symbol table");
nam = &strings[p->n_un.n_strx - sizeof(int)];
OpenPOWER on IntegriCloud