6cffa7
diff -rup binutils.orig/binutils/dwarf.c binutils-2.27/binutils/dwarf.c
6cffa7
--- binutils.orig/binutils/dwarf.c	2018-05-30 09:57:23.401080405 +0100
6cffa7
+++ binutils-2.27/binutils/dwarf.c	2018-05-30 09:57:33.578971357 +0100
6cffa7
@@ -5195,6 +5195,13 @@ display_debug_ranges (struct dwarf_secti
6cffa7
 	  continue;
6cffa7
 	}
6cffa7
 
6cffa7
+      if (next < section_begin || next >= finish)
6cffa7
+	{
6cffa7
+	  warn (_("Corrupt offset (%#8.8lx) in range entry %u\n"),
6cffa7
+		(unsigned long) offset, i);
6cffa7
+	  continue;
6cffa7
+	}
6cffa7
+
6cffa7
       if (dwarf_check != 0 && i > 0)
6cffa7
 	{
6cffa7
 	  if (start < next)