mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 10:03:47 +08:00
[opcodes/arm] Fix potential null pointer dereferences
PR tdep/29598 As pointed out in the bug ticket, we have a couple potential null pointer dereferencing situations. Harden those. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29598
This commit is contained in:
parent
94355de775
commit
76a95facf1
@ -12484,6 +12484,10 @@ mapping_symbol_for_insn (bfd_vma pc, struct disassemble_info *info,
|
||||
bool found = false;
|
||||
bool can_use_search_opt_p = false;
|
||||
|
||||
/* Sanity check. */
|
||||
if (info == NULL)
|
||||
return false;
|
||||
|
||||
/* Default to DATA. A text section is required by the ABI to contain an
|
||||
INSN mapping symbol at the start. A data section has no such
|
||||
requirement, hence if no mapping symbol is found the section must
|
||||
@ -12497,7 +12501,7 @@ mapping_symbol_for_insn (bfd_vma pc, struct disassemble_info *info,
|
||||
type = MAP_ARM;
|
||||
struct arm_private_data *private_data;
|
||||
|
||||
if (info->private_data == NULL
|
||||
if (info->private_data == NULL || info->symtab == NULL
|
||||
|| info->symtab_size == 0
|
||||
|| bfd_asymbol_flavour (*info->symtab) != bfd_target_elf_flavour)
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user