2007-08-21 Michael Snyder <msnyder@access-company.com>
authorMichael Snyder <msnyder@vmware.com>
Wed, 22 Aug 2007 01:57:05 +0000 (01:57 +0000)
committerMichael Snyder <msnyder@vmware.com>
Wed, 22 Aug 2007 01:57:05 +0000 (01:57 +0000)
* dbxread.c (read_dbx_symtab): Guard null deref.
Break up long line.

gdb/ChangeLog
gdb/dbxread.c

index 8c6751b0447ca74307efffbbc6f153e348b2ccf6..84cc94decbd446c78fe117b843397de47fe815c4 100644 (file)
@@ -1,5 +1,8 @@
 2007-08-21  Michael Snyder  <msnyder@access-company.com>
 
+       * dbxread.c (read_dbx_symtab): Guard null deref.
+       Break up long line.
+
        * valops.c (find_overload_match): Guard against NULL.
 
 2007-08-21  Daniel Jacobowitz  <dan@codesourcery.com>
index bba9995a5e281843b46b9f5986f5197a532e6595..f66c22fa5c9b50c7cd6788de616b4d5e24f8df23 100644 (file)
@@ -1828,7 +1828,8 @@ read_dbx_symtab (struct objfile *objfile)
                function_outside_compilation_unit_complaint (name);
                xfree (name);
              }
-           nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+           nlist.n_value += ANOFFSET (objfile->section_offsets, 
+                                      SECT_OFF_TEXT (objfile));
            /* Kludges for ELF/STABS with Sun ACC */
            last_function_name = namestring;
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
@@ -1838,7 +1839,9 @@ read_dbx_symtab (struct objfile *objfile)
                                           SECT_OFF_TEXT (objfile)))
              {
                CORE_ADDR minsym_valu = 
-                 find_stab_function_addr (namestring, pst->filename, objfile);
+                 find_stab_function_addr (namestring, 
+                                          pst ? pst->filename : NULL, 
+                                          objfile);
                /* find_stab_function_addr will return 0 if the minimal
                   symbol wasn't found.  (Unfortunately, this might also
                   be a valid address.)  Anyway, if it *does* return 0,
@@ -1893,7 +1896,8 @@ read_dbx_symtab (struct objfile *objfile)
                function_outside_compilation_unit_complaint (name);
                xfree (name);
              }
-           nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+           nlist.n_value += ANOFFSET (objfile->section_offsets, 
+                                      SECT_OFF_TEXT (objfile));
            /* Kludges for ELF/STABS with Sun ACC */
            last_function_name = namestring;
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
@@ -1903,7 +1907,9 @@ read_dbx_symtab (struct objfile *objfile)
                                           SECT_OFF_TEXT (objfile)))
              {
                CORE_ADDR minsym_valu = 
-                 find_stab_function_addr (namestring, pst->filename, objfile);
+                 find_stab_function_addr (namestring, 
+                                          pst ? pst->filename : NULL, 
+                                          objfile);
                /* find_stab_function_addr will return 0 if the minimal
                   symbol wasn't found.  (Unfortunately, this might also
                   be a valid address.)  Anyway, if it *does* return 0,