aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/symorder
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1995-01-21 10:24:18 +0000
committerBruce Evans <bde@FreeBSD.org>1995-01-21 10:24:18 +0000
commit742c88a03ad5d7932b9fa7611d583a38f0a63c28 (patch)
tree56f560fda3980b6f8a0a3f7281ff7b45d34c9418 /usr.bin/symorder
parent60efec1dab6a467a64d04fa487ed18f30ea6afc6 (diff)
downloadsrc-742c88a03ad5d7932b9fa7611d583a38f0a63c28.tar.gz
src-742c88a03ad5d7932b9fa7611d583a38f0a63c28.zip
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().
Notes
Notes: svn path=/head/; revision=5763
Diffstat (limited to 'usr.bin/symorder')
-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 f2f4ef230966..3644312a9f55 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)];