summaryrefslogtreecommitdiffstats
path: root/contrib/binutils
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-03-04 01:10:09 +0000
committeremaste <emaste@FreeBSD.org>2015-03-04 01:10:09 +0000
commite28f1e3a99a10a7ff33771dad3d6adccaea8c93c (patch)
treec82575bcb831b97711d64d1eab8ba05dc0b6731c /contrib/binutils
parent6dec850dfa4f1b51c22e8f878cf19a0747285d71 (diff)
downloadFreeBSD-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.c3
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)
OpenPOWER on IntegriCloud