The two operands are 16 bit and the result is being saved into a
larger type. Reduce the possibility of an overflow during multiplication
by using the larger type as an operand.
---
 cpukit/score/src/objectextendinformation.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cpukit/score/src/objectextendinformation.c 
b/cpukit/score/src/objectextendinformation.c
index 414766f219..f9c51c3bec 100644
--- a/cpukit/score/src/objectextendinformation.c
+++ b/cpukit/score/src/objectextendinformation.c
@@ -115,7 +115,8 @@ Objects_Maximum _Objects_Extend_information(
    * Allocate the name table, and the objects and if it fails either return or
    * generate a fatal error depending on auto-extending being active.
    */
-  object_block_size = extend_count * information->object_size;
+  object_block_size = extend_count;
+  object_block_size *= information->object_size;
   new_object_block = _Workspace_Allocate( object_block_size );
   if ( new_object_block == NULL ) {
     return 0;
-- 
2.39.2

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to