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

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