[binutils-gdb] Avoid segfault on invalid directory table
sergiodj+buildbot@sergiodj.net
sergiodj+buildbot@sergiodj.net
Fri Mar 24 15:38:00 GMT 2017
*** TEST RESULTS FOR COMMIT 568c1b9f503649d19ed1d17e6970f212e6b6317d ***
Author: Pdraig Brady <pbrady@fb.com>
Branch: master
Commit: 568c1b9f503649d19ed1d17e6970f212e6b6317d
Avoid segfault on invalid directory table
gdb was segfaulting during backtrace on a binary here, where
fe->dir_index parsed from the DWARF info was seen to access beyond the
provided include_dirs array.
This commit bounds the access to entries actually written to the
array, and was verified to output the backtrace correctly.
gdb/ChangeLog:
* dwarf2read.c (setup_type_unit_groups): Ensure dir_index doesn't
reference beyond the 'lh->include_dirs' array before accessing to
it.
(psymtab_include_file_name): Likewise.
(dwarf_decode_lines_1): Likewise.
(dwarf_decode_lines): Likewise.
(file_file_name): Likewise.
More information about the Gdb-testers
mailing list