This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] dwarf2read.c: Clean up out of bounds handling
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 27 Mar 2017 16:06:10 +0100
- Subject: Re: [PATCH] dwarf2read.c: Clean up out of bounds handling
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1A79C569E
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1A79C569E
- References: <1490369067-11867-1-git-send-email-palves@redhat.com>
On 03/24/2017 03:24 PM, Pedro Alves wrote:
> From: Pádraig Brady <pbrady@fb.com>
The above was automatically inserted by git send-email, because
I had messed up the commit's git author locally. I've fixed it
locally (I'm the author) ...
> Multiple places in dwarf2read.c open code 1-based to 0-based index
> conversion and check for out of bounds accesses to lh->include_dirs
> and lh->file_names. This commit factors those out to a couple methods
> and uses them throughout.
>
> gdb/ChangeLog:
> * dwarf2read.c (file_entry) <dir_index>: Add comment.
> (file_entry::include_dir): New method.
> (line_header::include_dir_at, line_header::file_name_at): New
> methods.
> (setup_type_unit_groups, setup_type_unit_groups)
> (psymtab_include_file_name): Simplify using the new methods.
> (lnp_state_machine) <the_line_header>: New field.
> <file>: Add comment.
> (lnp_state_machine::current_file): New method.
> (init_lnp_state_machine): Initialize the "the_line_header" field.
> (dwarf_decode_lines_1, dwarf_decode_lines, file_file_name):
> Simplify using the new methods.
... and pushed to master, after Pádraig confirmed gdb still gracefully
handles the problematic binary:
https://sourceware.org/ml/gdb-patches/2017-03/msg00451.html
Thanks,
Pedro Alves