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

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