Blame SOURCES/binutils-CVE-2019-1010204.patch

8d443f
--- binutils.orig/gold/fileread.cc	2019-08-06 14:22:08.669313110 +0100
8d443f
+++ binutils-2.32/gold/fileread.cc	2019-08-06 14:22:28.799177543 +0100
8d443f
@@ -381,6 +381,12 @@ File_read::do_read(off_t start, section_
8d443f
   ssize_t bytes;
8d443f
   if (this->whole_file_view_ != NULL)
8d443f
     {
8d443f
+      // See PR 23765 for an example of a testcase that triggers this error.
8d443f
+      if (((ssize_t) start) < 0)
8d443f
+	gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"),
8d443f
+		   this->filename().c_str(),
8d443f
+		   static_cast<long long>(start));
8d443f
+	
8d443f
       bytes = this->size_ - start;
8d443f
       if (static_cast<section_size_type>(bytes) >= size)
8d443f
 	{