+2018-02-01 Alan Modra <amodra@gmail.com>
+
+ PR 22769
+ * objdump.c (load_specific_debug_section): Check for overflow
+ when adding one to section size for a string section terminator.
+
2018-01-30 Nick Clifton <nickc@redhat.com>
PR 22734
struct dwarf_section *section = &debug_displays [debug].section;
bfd *abfd = (bfd *) file;
bfd_byte *contents;
+ bfd_size_type amt;
if (section->start != NULL)
{
section->num_relocs = 0;
section->address = bfd_get_section_vma (abfd, sec);
section->size = bfd_get_section_size (sec);
- section->start = contents = malloc (section->size + 1);
+ amt = section->size + 1;
+ section->start = contents = malloc (amt);
section->user_data = sec;
- if (section->start == NULL
+ if (amt == 0
+ || section->start == NULL
|| !bfd_get_full_section_contents (abfd, sec, &contents))
{
free_debug_section (debug);