diff options
author | Michael Snyder <msnyder@vmware.com> | 2007-08-22 01:57:05 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2007-08-22 01:57:05 +0000 |
commit | 6b2d86bda4d98894598f17fb8682e7cd4eafd833 (patch) | |
tree | bd5f91aeef72d9af17d4211b09a72edb65622bd5 /gdb/dbxread.c | |
parent | a2ca50ae64c82fac1d5ed8f31b9cf830738b80f7 (diff) | |
download | gdb-6b2d86bda4d98894598f17fb8682e7cd4eafd833.zip gdb-6b2d86bda4d98894598f17fb8682e7cd4eafd833.tar.gz gdb-6b2d86bda4d98894598f17fb8682e7cd4eafd833.tar.bz2 |
2007-08-21 Michael Snyder <msnyder@access-company.com>
* dbxread.c (read_dbx_symtab): Guard null deref.
Break up long line.
Diffstat (limited to 'gdb/dbxread.c')
-rw-r--r-- | gdb/dbxread.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c index bba9995..f66c22f 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -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, |