diff options
Diffstat (limited to '')
-rw-r--r-- | mld/link.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -399,6 +399,10 @@ static int relocate_instruction_rela(struct linker *linker, /// get the segment that the symbol is in struct segment_table_entry *ent; const char *segname = seg->obj->shstrtab->data + B32(shdr->sh_name); + if (B32(shdr->sh_name) >= seg->obj->shstrtab->len) { + ERROR("relocation segment name out of bounds"); + return M_ERROR; + } if (segtab_get(&linker->segments, &ent, segname)) { ERROR("could not locate segment for relocation"); return M_ERROR; |