This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb/dwarf2read.c: Sanity check DW_AT_sibling values.


>>>>> "Will" == Will Newton <will.newton@linaro.org> writes:

Will> When reading objects with corrupt debug information it is possible that
Will> the sibling chain can form a loop, which leads to an infinite loop and
Will> memory exhaustion.

Will> Avoid this situation by disregarding and DW_AT_sibling values that point
Will> to a lower address than the current entry.

Thanks for doing this.

Will> +	      const gdb_byte *sibling_ptr = buffer + dwarf2_get_ref_die_offset (&attr).sect_off;

This line is too long, it should be split somewhere.

Will> +	      if (sibling_ptr < info_ptr)
Will> +		complaint (&symfile_complaints,
Will> +			   _("DW_AT_sibling points backwards"));

I wonder whether the check should be "<=".

Will> +	      const gdb_byte *sibling_ptr = buffer + dwarf2_get_ref_die_offset (&attr).sect_off;

Also too long.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]