diff options
author | Alan Modra <amodra@gmail.com> | 2021-05-15 15:17:16 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-05-15 15:17:46 +0930 |
commit | 669f463dbc700ab2694c960bb3e3f1083323f500 (patch) | |
tree | 4b8af2c14d6817944ec46ff35b358b500757a97a /binutils | |
parent | 5250d2f0a536276cbc8735e53ae70425780b991f (diff) | |
download | fsf-binutils-gdb-669f463dbc700ab2694c960bb3e3f1083323f500.zip fsf-binutils-gdb-669f463dbc700ab2694c960bb3e3f1083323f500.tar.gz fsf-binutils-gdb-669f463dbc700ab2694c960bb3e3f1083323f500.tar.bz2 |
display_debug_rnglists_list
* dwarf.c (display_debug_rnglists_list): Avoid pointer UB.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 4 | ||||
-rw-r--r-- | binutils/dwarf.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 670ab97..db5ed0f 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,9 @@ 2021-05-15 Alan Modra <amodra@gmail.com> + * dwarf.c (display_debug_rnglists_list): Avoid pointer UB. + +2021-05-15 Alan Modra <amodra@gmail.com> + * dwarf.c (display_debug_str_offsets): Constrain reads to length given in header. diff --git a/binutils/dwarf.c b/binutils/dwarf.c index a0b84fc..c4b6edf 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -7603,7 +7603,7 @@ display_debug_rnglists_list (unsigned char *start, unsigned char *finish, /* Initialize it due to a false compiler warning. */ dwarf_vma begin = -1, length, end = -1; - if (start + 1 > finish) + if (start >= finish) { warn (_("Range list starting at offset 0x%lx is not terminated.\n"), offset); |