mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Ensure that the section header table is written out in an order
consistent with the section indices returned to the application by elf_ndxscn(). Submitted by: kaiw
This commit is contained in:
parent
df7d1e2023
commit
b23372cd8e
1 changed files with 2 additions and 3 deletions
|
|
@ -788,15 +788,14 @@ _libelf_write_elf(Elf *e, off_t newsize)
|
|||
src.d_buf = &scn->s_shdr.s_shdr64;
|
||||
|
||||
dst.d_size = fsz;
|
||||
dst.d_buf = newfile + rc;
|
||||
dst.d_buf = newfile + rc + scn->s_ndx * fsz;
|
||||
|
||||
if (_libelf_xlate(&dst, &src, e->e_byteorder, ec,
|
||||
ELF_TOFILE) != &dst)
|
||||
goto error;
|
||||
|
||||
rc += fsz;
|
||||
}
|
||||
|
||||
rc += e->e_u.e_elf.e_nscn * fsz;
|
||||
if (maxrc > rc)
|
||||
rc = maxrc;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue