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

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