mingw-binutils/binutils-CVE-2019-1010204.patch
DistroBaker c976b1ba25 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/mingw-binutils.git#d64b64711179af8e3626c00d6b8041726dc3e6d8
2020-12-18 03:26:09 +00:00

17 lines
724 B
Diff

diff -rupN --no-dereference binutils-2.34/gold/fileread.cc binutils-2.34-new/gold/fileread.cc
--- binutils-2.34/gold/fileread.cc 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/gold/fileread.cc 2020-12-18 02:57:23.485023881 +0100
@@ -381,6 +381,12 @@ File_read::do_read(off_t start, section_
ssize_t bytes;
if (this->whole_file_view_ != NULL)
{
+ // See PR 23765 for an example of a testcase that triggers this error.
+ if (((ssize_t) start) < 0)
+ gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"),
+ this->filename().c_str(),
+ static_cast<long long>(start));
+
bytes = this->size_ - start;
if (static_cast<section_size_type>(bytes) >= size)
{