diff options
author | Zack Weinberg <zackw@panix.com> | 2004-05-07 00:01:25 +0000 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2004-05-07 00:01:25 +0000 |
commit | eb61d2d606dacb82c4447dd45c78e4e04f77206e (patch) | |
tree | 020d70d499d59fb5e32bd79ffef04a9956d83db5 /bfd/dwarf2.c | |
parent | 00ed60a15b827d61b55d8159628ef76d0e6dba43 (diff) | |
download | gdb-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.c | 5 |
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); } |