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

4ede5d
--- binutils.orig/gold/fileread.cc	2019-11-08 10:33:58.911577903 +0000
4ede5d
+++ binutils-2.30/gold/fileread.cc	2019-11-08 10:34:13.001470092 +0000
4ede5d
@@ -381,6 +381,12 @@ File_read::do_read(off_t start, section_
4ede5d
   ssize_t bytes;
4ede5d
   if (this->whole_file_view_ != NULL)
4ede5d
     {
4ede5d
+      // See PR 23765 for an example of a testcase that triggers this error.
4ede5d
+      if (((ssize_t) start) < 0)
4ede5d
+	gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"),
4ede5d
+		   this->filename().c_str(),
4ede5d
+		   static_cast<long long>(start));
4ede5d
+	
4ede5d
       bytes = this->size_ - start;
4ede5d
       if (static_cast<section_size_type>(bytes) >= size)
4ede5d
 	{