This commit is contained in:
Nicolas Ontiveros 2020-10-27 12:40:39 -07:00
Родитель 85330c701f
Коммит 993d242031
1 изменённых файлов: 21 добавлений и 11 удалений

Просмотреть файл

@ -1,27 +1,37 @@
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -2803,8 +2803,8 @@
@@ -2803,13 +2803,13 @@
}
static bfd_boolean
-find_abstract_instance (struct comp_unit * unit,
- bfd_byte * orig_info_ptr,
- struct attribute * attr_ptr,
- const char ** pname,
- bfd_boolean * is_linkage,
- char ** filename_ptr,
- int * linenumber_ptr)
+find_abstract_instance (struct comp_unit *unit,
+ unsigned int recur_count,
struct attribute * attr_ptr,
const char ** pname,
bfd_boolean * is_linkage,
+ struct attribute *attr_ptr,
+ unsigned int recur_count,
+ const char **pname,
+ bfd_boolean *is_linkage,
+ char **filename_ptr,
+ int *linenumber_ptr)
{
bfd *abfd = unit->abfd;
bfd_byte *info_ptr;
@@ -2820,6 +2820,14 @@
struct attribute attr;
const char *name = NULL;
+ if (recur_count == 100)
+ {
+ _bfd_error_handler
+ (_("DWARF error: abstract instance recursion detected"));
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+ {
+ _bfd_error_handler
+ (_("DWARF error: abstract instance recursion detected"));
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
/* DW_FORM_ref_addr can reference an entry in a different CU. It
is an offset from the .debug_info section, not the current CU. */