forked from Imagelibrary/binutils-gdb
* dwarf2.c (add_line_info): Also set info->filename to NULL if
filename argument is null; do not call strlen on a null pointer.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user