Page MenuHomeFreeBSD

D59635.id186580.diff
No OneTemporary

D59635.id186580.diff

diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -1785,14 +1785,19 @@
void
digest_notes(Obj_Entry *obj, Elf_Addr note_start, Elf_Addr note_end)
{
- const Elf_Note *note;
+ const Elf_Note *note, *next_note;
const char *note_name;
uintptr_t p;
- for (note = (const Elf_Note *)note_start; (Elf_Addr)note < note_end;
- note = (const Elf_Note *)((const char *)(note + 1) +
- roundup2(note->n_namesz, sizeof(Elf32_Addr)) +
- roundup2(note->n_descsz, sizeof(Elf32_Addr)))) {
+ for (note = (const Elf_Note *)note_start;; note = next_note) {
+ if ((Elf_Addr)note + sizeof(Elf_Note) - 1 >= note_end)
+ break;
+ next_note = (const Elf_Note *)((const char *)(note + 1) +
+ roundup2(note->n_namesz, sizeof(Elf32_Addr)) +
+ roundup2(note->n_descsz, sizeof(Elf32_Addr)));
+ if ((Elf_Addr)next_note - 1 >= note_end)
+ break;
+
if (arch_digest_note(obj, note))
continue;

File Metadata

Mime Type
text/plain
Expires
Fri, Sep 25, 12:36 AM (5 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38902126
Default Alt Text
D59635.id186580.diff (973 B)

Event Timeline