From 469bf12ca7722e275d92773d1fb0a3737142d7a2 Mon Sep 17 00:00:00 2001 From: "Victor M. Alvarez" Date: Fri, 30 Oct 2015 19:48:31 +0100 Subject: [PATCH] Remove sanity check introduced in previous commit. section->size if not necessarily lesser than elf_size because sections don't always represent a chunk of data inside the ELF file. Sections of type SHT_NOBITS can have arbitrary sizes not related to the the ELF file size. --- libyara/modules/elf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libyara/modules/elf.c b/libyara/modules/elf.c index 05b9045f20..443958f92b 100644 --- a/libyara/modules/elf.c +++ b/libyara/modules/elf.c @@ -84,7 +84,6 @@ uint64_t elf_rva_to_offset_##bits( \ { \ if (section->type != ELF_SHT_NULL && \ section->type != ELF_SHT_NOBITS && \ - section->size <= elf_size && \ rva >= section->addr && \ rva < section->addr + section->size) \ { \