The format_count entry can't be zero unless the count is also zero.
PR 22200
* dwarf2.c (read_formatted_entries): Error on format_count zero.
+2017-09-25 Alan Modra <amodra@gmail.com>
+
+ PR 22200
+ * dwarf2.c (read_formatted_entries): Error on format_count zero.
+
2017-09-24 Alan Modra <amodra@gmail.com>
PR 22197
data_count = _bfd_safe_read_leb128 (abfd, buf, &bytes_read, FALSE, buf_end);
buf += bytes_read;
+ if (format_count == 0 && data_count != 0)
+ {
+ _bfd_error_handler (_("Dwarf Error: Zero format count."));
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
for (datai = 0; datai < data_count; datai++)
{
bfd_byte *format = format_header_data;