aboutsummaryrefslogtreecommitdiff
path: root/bfd/libbfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/libbfd.c')
-rw-r--r--bfd/libbfd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/libbfd.c b/bfd/libbfd.c
index 33d9c01..bf49a2e 100644
--- a/bfd/libbfd.c
+++ b/bfd/libbfd.c
@@ -820,7 +820,8 @@ _bfd_generic_get_section_contents (bfd *abfd,
return TRUE;
sz = section->rawsize ? section->rawsize : section->size;
- if (offset + count > sz)
+ if (offset + count < count
+ || offset + count > sz)
{
bfd_set_error (bfd_error_invalid_operation);
return FALSE;