[binutils-gdb] ubsan: alpha-coff: signed integer overflow

Alan Modra amodra@sourceware.org
Fri Jan 10 11:11:00 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=71780f455fbf35ed4c48e94b4228c55c11a213c8

commit 71780f455fbf35ed4c48e94b4228c55c11a213c8
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Jan 9 06:41:25 2020 +1030

    ubsan: alpha-coff: signed integer overflow
    
    	* coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.

Diff:
---
 bfd/ChangeLog    | 4 ++++
 bfd/coff-alpha.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index aae0832..68b1519 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2020-01-10  Alan Modra  <amodra@gmail.com>
+
+	* coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
+
 2020-01-09  Nick Clifton  <nickc@redhat.com>
 
 	PR 25221
diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c
index 0baac2a..4b39bcc 100644
--- a/bfd/coff-alpha.c
+++ b/bfd/coff-alpha.c
@@ -423,7 +423,7 @@ alpha_ecoff_object_p (bfd *abfd)
 	{
 	  bfd_size_type size;
 
-	  size = sec->line_filepos * 8;
+	  size = (bfd_size_type) sec->line_filepos * 8;
 	  BFD_ASSERT (size == sec->size
 		      || size + 8 == sec->size);
 	  if (!bfd_set_section_size (sec, size))



More information about the Binutils-cvs mailing list