ubsan: alpha-coff: signed integer overflow

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ubsan: alpha-coff: signed integer overflow

Alan Modra-3
        * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.

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))

--
Alan Modra
Australia Development Lab, IBM