ubsan: alpha-coff: signed integer overflow

Message ID 20200110110527.GC4433@bubble.grove.modra.org
State New
Headers show
Series
  • ubsan: alpha-coff: signed integer overflow
Related show

Commit Message

Alan Modra Jan. 10, 2020, 11:05 a.m.
* coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c
index 0baac2a24a..4b39bcc999 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))