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

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