diff options
author | Freya Murphy <freya@freyacat.org> | 2024-09-22 16:44:54 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-09-22 16:44:54 -0400 |
commit | bf39d3283bbc83773459ae5d399ead2bf4452fb7 (patch) | |
tree | 9826d286dba8ec8f0b6fe23af5aafbc7f4e48ad2 /mld/seg.c | |
parent | mld done (diff) | |
download | mips-bf39d3283bbc83773459ae5d399ead2bf4452fb7.tar.gz mips-bf39d3283bbc83773459ae5d399ead2bf4452fb7.tar.bz2 mips-bf39d3283bbc83773459ae5d399ead2bf4452fb7.zip |
fix mem errors
Diffstat (limited to '')
-rw-r--r-- | mld/seg.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -43,6 +43,11 @@ static int load_shdr(struct object *obj, struct segment *seg, size_t index) } seg->name = &obj->shstrtab->data[name]; + if (seg->phdr->p_filesz != hdr->sh_size) { + ERROR("segment phdr and shdr file sizes to not match"); + return M_ERROR; + } + // map bytes uint32_t len = B32(hdr->sh_size); uint32_t off = B32(hdr->sh_offset); |