PR binutils/20891
* aoutx.h (find_nearest_line): Handle the case where the main file
name and the directory name are both empty.
+2016-12-01 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/20891
+ * aoutx.h (find_nearest_line): Handle the case where the main file
+ name and the directory name are both empty.
+
2016-11-30 Alan Modra <amodra@gmail.com>
* elf.c (get_program_header_size): Revert accidental change.
char *buf;
*filename_ptr = abfd->filename;
- *functionname_ptr = 0;
+ *functionname_ptr = NULL;
*line_ptr = 0;
if (disriminator_ptr)
*disriminator_ptr = 0;
*filename_ptr = main_file_name;
else
{
- sprintf (buf, "%s%s", directory_name, main_file_name);
- *filename_ptr = buf;
- buf += filelen + 1;
+ if (buf == NULL)
+ /* PR binutils/20891: In a corrupt input file both
+ main_file_name and directory_name can be empty... */
+ * filename_ptr = NULL;
+ else
+ {
+ snprintf (buf, filelen + 1, "%s%s", directory_name,
+ main_file_name);
+ *filename_ptr = buf;
+ buf += filelen + 1;
+ }
}
}