aboutsummaryrefslogtreecommitdiff
path: root/bfd/dwarf2.c
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2004-05-07 00:01:25 +0000
committerZack Weinberg <zackw@panix.com>2004-05-07 00:01:25 +0000
commiteb61d2d606dacb82c4447dd45c78e4e04f77206e (patch)
tree020d70d499d59fb5e32bd79ffef04a9956d83db5 /bfd/dwarf2.c
parent00ed60a15b827d61b55d8159628ef76d0e6dba43 (diff)
downloadgdb-eb61d2d606dacb82c4447dd45c78e4e04f77206e.zip
gdb-eb61d2d606dacb82c4447dd45c78e4e04f77206e.tar.gz
gdb-eb61d2d606dacb82c4447dd45c78e4e04f77206e.tar.bz2
* dwarf2.c (add_line_info): Also set info->filename to NULL if
filename argument is null; do not call strlen on a null pointer.
Diffstat (limited to 'bfd/dwarf2.c')
-rw-r--r--bfd/dwarf2.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index ceb28af..6182ea9 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -801,10 +801,9 @@ add_line_info (struct line_info_table *table,
info->column = column;
info->end_sequence = end_sequence;
- amt = strlen (filename);
- if (amt)
+ if (filename && filename[0])
{
- info->filename = bfd_alloc (table->abfd, amt + 1);
+ info->filename = bfd_alloc (table->abfd, strlen (filename) + 1);
if (info->filename)
strcpy (info->filename, filename);
}