mirror of
https://git.FreeBSD.org/src.git
synced 2025-02-04 17:15:50 +00:00
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().
This commit is contained in:
parent
60efec1dab
commit
742c88a03a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=5763
@ -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)];
|
||||
|
Loading…
x
Reference in New Issue
Block a user