diff options
author | emaste <emaste@FreeBSD.org> | 2015-02-25 22:12:37 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2015-02-25 22:12:37 +0000 |
commit | 24cf02dda73fad520ddb2ccc81c8ece971442765 (patch) | |
tree | a5f6924326de9ef896f080472433dfed745f170a /contrib/binutils | |
parent | 72abec5bf27b79c59dfbdcb9d6687fab563ac50b (diff) | |
download | FreeBSD-src-24cf02dda73fad520ddb2ccc81c8ece971442765.zip FreeBSD-src-24cf02dda73fad520ddb2ccc81c8ece971442765.tar.gz |
GNU nm: Avoid NULL dereference
bfd_dwarf2_find_line() calls find_line() with NULL functionname_ptr,
which resulted in a crash on certain ELF objects.
This change was implemented independently from upstream binutils, but
I have checked that the crash does not happen there.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'contrib/binutils')
-rw-r--r-- | contrib/binutils/bfd/dwarf2.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/binutils/bfd/dwarf2.c b/contrib/binutils/bfd/dwarf2.c index 6554f0f..1c3d7e9 100644 --- a/contrib/binutils/bfd/dwarf2.c +++ b/contrib/binutils/bfd/dwarf2.c @@ -2382,7 +2382,8 @@ find_line (bfd *abfd, else addr += section->vma; *filename_ptr = NULL; - *functionname_ptr = NULL; + if (!do_line) + *functionname_ptr = NULL; *linenumber_ptr = 0; if (! *pinfo) |