+2019-09-23 Alan Modra <amodra@gmail.com>
+
+ PR 25018
+ * dwarf.c (get_type_signedness): Delete ineffective pointer
+ comparison check. Properly range check uvalue offset on
+ recursive call.
+ (read_and_display_attr_value): Range check uvalue offset before
+ calling get_type_signedness.
+
2019-09-20 Alan Modra <amodra@gmail.com>
* ar.c (write_archive): Use bfd_set_thin_archive.
* is_signed = FALSE;
- if (data >= end)
- return;
-
abbrev_number = read_uleb128 (data, & bytes_read, end);
data += bytes_read;
NB/ We need to avoid infinite recursion. */
return;
}
+ if (uvalue >= (size_t) (end - start))
+ return;
get_type_signedness (start, start + uvalue, end, pointer_size,
offset_size, dwarf_version, is_signed, TRUE);
break;
switch (attribute)
{
case DW_AT_type:
- if (level >= 0 && level < MAX_CU_NESTING)
+ if (level >= 0 && level < MAX_CU_NESTING
+ && uvalue < (size_t) (end - start))
{
bfd_boolean is_signed = FALSE;