[PATCH][Bug binutils/4797] SEGV fault due to NULL pointer deref in dwarf2.c

Doug Kwan (關振德) dougkwan@google.com
Wed Jul 18 01:24:00 GMT 2007


Hi

      Could someone review this and check that in? Thanks.

-Doug


2007-07-17  Doug Kwan  <dougkwan@google.com>

        PR binutils/4797
        * dwarf2.c: (find_line) Do not dereference functionname_ptr if
        do_line is true.

Index: bfd/dwarf2.c
===================================================================
RCS file: /cvs/src/src/bfd/dwarf2.c,v
retrieving revision 1.97
diff -u -u -r1.97 dwarf2.c
--- bfd/dwarf2.c        3 Jul 2007 14:26:40 -0000       1.97
+++ bfd/dwarf2.c        17 Jul 2007 19:27:44 -0000
@@ -2380,7 +2380,8 @@
   else
     addr += section->vma;
   *filename_ptr = NULL;
-  *functionname_ptr = NULL;
+  if (! do_line)
+    *functionname_ptr = NULL;
   *linenumber_ptr = 0;

   if (! *pinfo)



More information about the Binutils mailing list