mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-21 01:12:32 +08:00
Fix address violation bug when disassembling a corrupt SH binary.
PR binutils/21578 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid flag value.
This commit is contained in:
parent
ae87f7e73e
commit
f461bbd847
@ -1,3 +1,9 @@
|
||||
2017-06-14 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR binutils/21578
|
||||
* elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
|
||||
flag value.
|
||||
|
||||
2017-06-14 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR binutils/21589
|
||||
|
@ -6344,7 +6344,7 @@ sh_elf_set_mach_from_flags (bfd *abfd)
|
||||
{
|
||||
flagword flags = elf_elfheader (abfd)->e_flags & EF_SH_MACH_MASK;
|
||||
|
||||
if (flags >= sizeof(sh_ef_bfd_table))
|
||||
if (flags >= ARRAY_SIZE (sh_ef_bfd_table))
|
||||
return FALSE;
|
||||
|
||||
if (sh_ef_bfd_table[flags] == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user