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

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