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

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