aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2017-06-27 00:21:25 +0100
committerPedro Alves <palves@redhat.com>2017-06-27 00:21:25 +0100
commitab27f80c5dceaa23c4ba7f62c0d5d22a5d5dd7a1 (patch)
tree4ccb4ad8a0456d1ae742f8bea210d1c433ca9cc7 /bfd
parent1f473e3d0ad285195934e6a077c7ed32afe66437 (diff)
downloadgdb-ab27f80c5dceaa23c4ba7f62c0d5d22a5d5dd7a1.zip
gdb-ab27f80c5dceaa23c4ba7f62c0d5d22a5d5dd7a1.tar.gz
gdb-ab27f80c5dceaa23c4ba7f62c0d5d22a5d5dd7a1.tar.bz2
Fix GDB regressions caused by previous bfd_get_section_contents changes
Ref: https://sourceware.org/ml/binutils/2017-06/msg00343.html bfd/ChangeLog: 2017-06-26 Pedro Alves <palves@redhat.com> PR binutils/21665 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not "sz".
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/libbfd.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index fbe2049..c2491d5 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2017-06-26 Pedro Alves <palves@redhat.com>
+
+ PR binutils/21665
+ * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
+ "sz".
+
2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/21665
diff --git a/bfd/libbfd.c b/bfd/libbfd.c
index 7b270ef..b8c65b5 100644
--- a/bfd/libbfd.c
+++ b/bfd/libbfd.c
@@ -820,7 +820,7 @@ _bfd_generic_get_section_contents (bfd *abfd,
}
if (offset + count < count
|| offset + count > sz
- || (section->filepos + offset + sz) > (bfd_size_type) filesz)
+ || (section->filepos + offset + count) > (bfd_size_type) filesz)
{
bfd_set_error (bfd_error_invalid_operation);
return FALSE;