[13/19] display_debug_rnglists_list

Message ID 20210515080957.20305-14-amodra@gmail.com
State New
Headers show
Series
  • Pointer UB in binutils/dwarf.c
Related show

Commit Message

Alan Modra via Binutils May 15, 2021, 8:09 a.m.
* dwarf.c (display_debug_rnglists_list): Avoid pointer UB.

Patch

diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index a0b84fc8d85..c4b6edf8721 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);