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

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