forked from Imagelibrary/binutils-gdb
Fixes for memory access violations triggered by running addr2line on fuzzed binaries.
PR binutils/17512 * addr2line.c (slurp_symtab): If the symcount is zero, free the symbol table pointer. * dwarf2.c (concat_filename): Check for an empty directory table. (scan_unit_for_symbols): Check for reading off the end of the unit. (parse_comp_unit): Check for a DW_AT_comp_dir attribute with a non-string form. * elf64-ppc.c (opd_entry_value): Fail if there are no relocs available.
This commit is contained in:
@@ -140,6 +140,14 @@ slurp_symtab (bfd *abfd)
|
||||
syms = xmalloc (storage);
|
||||
symcount = bfd_canonicalize_dynamic_symtab (abfd, syms);
|
||||
}
|
||||
|
||||
/* PR 17512: file: 2a1d3b5b.
|
||||
Do not pretend that we have some symbols when we don't. */
|
||||
if (symcount <= 0)
|
||||
{
|
||||
free (syms);
|
||||
syms = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* These global variables are used to pass information between
|
||||
|
||||
Reference in New Issue
Block a user