On coff_slurp_symbol_table printing "unrecognized storage class"
for a symbol error. If the symbol name is the last string in its
section and not terminated, we run off the end of the buffer.
* coffgen.c (build_debug_section): Terminate the section with
an extra 0.
return NULL;
sec_size = sect->size;
- debug_section = (char *) _bfd_alloc_and_read (abfd, sec_size, sec_size);
+ debug_section = (char *) _bfd_alloc_and_read (abfd, sec_size + 1, sec_size);
if (debug_section == NULL)
return NULL;
+ debug_section[sec_size] = 0;
if (bfd_seek (abfd, position, SEEK_SET) != 0)
return NULL;