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
This commit is contained in:
Ed Maste 2015-02-25 22:12:37 +00:00
parent 75493a82e0
commit 4b8807a4d3

View File

@ -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)