13ae24
--- binutils.orig/binutils/dwarf.c	2018-05-01 11:42:02.656431736 +0100
13ae24
+++ binutils-2.30/binutils/dwarf.c	2018-05-01 11:43:24.210383020 +0100
13ae24
@@ -9244,7 +9244,18 @@ process_cu_tu_index (struct dwarf_sectio
13ae24
 		}
13ae24
 
13ae24
 	      if (!do_display)
13ae24
-		memcpy (&this_set[row - 1].signature, ph, sizeof (uint64_t));
13ae24
+		{
13ae24
+		  size_t num_copy = sizeof (uint64_t);
13ae24
+
13ae24
+		  /* PR 23064: Beware of buffer overflow.  */
13ae24
+		  if (ph + num_copy < limit)
13ae24
+		    memcpy (&this_set[row - 1].signature, ph, num_copy);
13ae24
+		  else
13ae24
+		    {
13ae24
+		      warn (_("Signature (%p) extends beyond end of space in section\n"), ph);
13ae24
+		      return 0;
13ae24
+		    }
13ae24
+		}
13ae24
 
13ae24
 	      prow = poffsets + (row - 1) * ncols * 4;
13ae24
 	      /* PR 17531: file: b8ce60a8.  */