diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2021-02-02 10:40:50 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-02-02 10:40:50 -0500 |
commit | 5e4d9bbc4b4e57eacb614c38f30dac9af08cace8 (patch) | |
tree | dd9185a7ddb8a3754ea3042d4baad15ba2973ad2 /gdb/ChangeLog | |
parent | a0c1eeba9b13b759b058dd5640ccb0dc2630a723 (diff) | |
download | gdb-5e4d9bbc4b4e57eacb614c38f30dac9af08cace8.zip gdb-5e4d9bbc4b4e57eacb614c38f30dac9af08cace8.tar.gz gdb-5e4d9bbc4b4e57eacb614c38f30dac9af08cace8.tar.bz2 |
gdb/dwarf: fix bound check in read_rnglist_index
I think this check in read_rnglist_index is wrong:
/* Validate that reading won't go beyond the end of the section. */
if (start_offset + cu->header.offset_size > rnglist_base + section->size)
error (_("Reading DW_FORM_rnglistx index beyond end of"
".debug_rnglists section [in module %s]"),
objfile_name (objfile));
The addition `rnglist_base + section->size` doesn't make sense.
rnglist_base is an offset into `section`, so it doesn't make sense to
add it to `section`'s size. `start_offset` also is an offset into
`section`, so we should just compare it to just `section->size`.
gdb/ChangeLog:
* dwarf2/read.c (read_rnglist_index): Fix bound check.
Change-Id: If0ff7c73f4f80f79aac447518f4e8f131f2db8f2
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dcbfc77..c71492d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2021-02-02 Simon Marchi <simon.marchi@efficios.com> + * dwarf2/read.c (read_rnglist_index): Fix bound check. + +2021-02-02 Simon Marchi <simon.marchi@efficios.com> + * dwarf2/read.c (read_loclist_index): Change complaints into errors. |