Fix a seg-fault disassembling a corrupt binary.
PR binutils/20892 * aoutx.h (find_nearest_line): Handle the case where the function name is empty.
This commit is contained in:
parent
6d6ad65b43
commit
e82ab856bb
2 changed files with 10 additions and 0 deletions
|
@ -4,6 +4,10 @@
|
||||||
* aoutx.h (find_nearest_line): Handle the case where the main file
|
* aoutx.h (find_nearest_line): Handle the case where the main file
|
||||||
name and the directory name are both empty.
|
name and the directory name are both empty.
|
||||||
|
|
||||||
|
PR binutils/20892
|
||||||
|
* aoutx.h (find_nearest_line): Handle the case where the function
|
||||||
|
name is empty.
|
||||||
|
|
||||||
2016-11-30 Alan Modra <amodra@gmail.com>
|
2016-11-30 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* elf.c (get_program_header_size): Revert accidental change.
|
* elf.c (get_program_header_size): Revert accidental change.
|
||||||
|
|
|
@ -2830,6 +2830,12 @@ NAME (aout, find_nearest_line) (bfd *abfd,
|
||||||
const char *function = func->name;
|
const char *function = func->name;
|
||||||
char *colon;
|
char *colon;
|
||||||
|
|
||||||
|
if (buf == NULL)
|
||||||
|
{
|
||||||
|
/* PR binutils/20892: In a corrupt input file func can be empty. */
|
||||||
|
* functionname_ptr = NULL;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
/* The caller expects a symbol name. We actually have a
|
/* The caller expects a symbol name. We actually have a
|
||||||
function name, without the leading underscore. Put the
|
function name, without the leading underscore. Put the
|
||||||
underscore back in, so that the caller gets a symbol name. */
|
underscore back in, so that the caller gets a symbol name. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue