mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-14 20:37:06 +00:00
libpe: Avoid a potential use-after-free in pe_update_symtab().
This function appears to be unused within FreeBSD and ELFToolChain. CID: 1418982 MFC after: 1 week Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
a9d65c5fae
commit
388586bcd8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=359173
|
@ -33,7 +33,7 @@ ELFTC_VCSID("$Id: pe_symtab.c 3312 2016-01-10 09:23:51Z kaiwang27 $");
|
||||||
int
|
int
|
||||||
pe_update_symtab(PE *pe, char *symtab, size_t sz, unsigned int nsym)
|
pe_update_symtab(PE *pe, char *symtab, size_t sz, unsigned int nsym)
|
||||||
{
|
{
|
||||||
PE_Scn *ps;
|
PE_Scn *ps, *pstmp;
|
||||||
PE_SecBuf *sb;
|
PE_SecBuf *sb;
|
||||||
PE_SecHdr *sh;
|
PE_SecHdr *sh;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ pe_update_symtab(PE *pe, char *symtab, size_t sz, unsigned int nsym)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove the old symbol table. */
|
/* Remove the old symbol table. */
|
||||||
STAILQ_FOREACH(ps, &pe->pe_scn, ps_next) {
|
STAILQ_FOREACH_SAFE(ps, &pe->pe_scn, ps_next, pstmp) {
|
||||||
if (ps->ps_ndx == 0xFFFFFFFFU)
|
if (ps->ps_ndx == 0xFFFFFFFFU)
|
||||||
libpe_release_scn(ps);
|
libpe_release_scn(ps);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue