Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Feb 2015 22:12:38 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r279301 - head/contrib/binutils/bfd
Message-ID:  <201502252212.t1PMCcu0062818@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Wed Feb 25 22:12:37 2015
New Revision: 279301
URL: https://svnweb.freebsd.org/changeset/base/279301

Log:
  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

Modified:
  head/contrib/binutils/bfd/dwarf2.c

Modified: head/contrib/binutils/bfd/dwarf2.c
==============================================================================
--- head/contrib/binutils/bfd/dwarf2.c	Wed Feb 25 21:59:03 2015	(r279300)
+++ head/contrib/binutils/bfd/dwarf2.c	Wed Feb 25 22:12:37 2015	(r279301)
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502252212.t1PMCcu0062818>