Blob Blame Raw
--- binutils.orig/binutils/dwarf.c	2018-07-11 11:45:09.971024884 +0100
+++ binutils-2.29/binutils/dwarf.c	2018-07-11 14:16:38.417025086 +0100
@@ -8509,7 +8509,18 @@ process_cu_tu_index (struct dwarf_sectio
 		}
 
 	      if (!do_display)
-		memcpy (&this_set[row - 1].signature, ph, sizeof (uint64_t));
+		{
+		  size_t num_copy = sizeof (uint64_t);
+
+		  /* PR 23064: Beware of buffer overflow.  */
+		  if (ph + num_copy < limit)
+		    memcpy (&this_set[row - 1].signature, ph, num_copy);
+		  else
+		    {
+		      warn (_("Signature (%p) extends beyond end of space in section\n"), ph);
+		      return 0;
+		    }
+		}
 
 	      prow = poffsets + (row - 1) * ncols * 4;
 	      /* PR 17531: file: b8ce60a8.  */