The > comparison should be >= to prevent an out of bounds array
access.
Fixes: 52dc0595d540 ("modpost: handle relocations mismatch in __ex_table.")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
static bool is_executable_section(struct elf_info *elf, unsigned int secndx)
{
- if (secndx > elf->num_sections)
+ if (secndx >= elf->num_sections)
return false;
return (elf->sechdrs[secndx].sh_flags & SHF_EXECINSTR) != 0;