Skip to content
Snippets Groups Projects
Commit c8b3d02c authored by Alan Modra's avatar Alan Modra
Browse files

objdump segfault after symbol table error

This memcpy segfaults if symcount is -1 (=> syms is NULL).
      memcpy (sorted_syms, symcount ? syms : dynsyms,
	      sorted_symcount * sizeof (asymbol *));

	* objdump.c (slurp_symtab): Don't leave symcount as -1 after
	an error.
	(slurp_dynamic_symtab): Likewise for dynsymcount.
parent 746598e0
No related branches found
No related tags found
No related merge requests found
......@@ -1015,6 +1015,7 @@ slurp_symtab (bfd *abfd)
my_bfd_nonfatal (bfd_get_filename (abfd));
free (sy);
sy = NULL;
symcount = 0;
}
return sy;
}
......@@ -1048,6 +1049,7 @@ slurp_dynamic_symtab (bfd *abfd)
my_bfd_nonfatal (bfd_get_filename (abfd));
free (sy);
sy = NULL;
dynsymcount = 0;
}
return sy;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment