diff options
author | emaste <emaste@FreeBSD.org> | 2015-03-04 01:10:09 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2015-03-04 01:10:09 +0000 |
commit | e28f1e3a99a10a7ff33771dad3d6adccaea8c93c (patch) | |
tree | c82575bcb831b97711d64d1eab8ba05dc0b6731c /contrib/binutils | |
parent | 6dec850dfa4f1b51c22e8f878cf19a0747285d71 (diff) | |
download | FreeBSD-src-e28f1e3a99a10a7ff33771dad3d6adccaea8c93c.zip FreeBSD-src-e28f1e3a99a10a7ff33771dad3d6adccaea8c93c.tar.gz |
MFC r279301: 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.
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) |