AnsweredAssumed Answered

STM32Cube FreeRTOS Bug

Question asked by allan.michael.002 on Sep 7, 2016
Latest reply on Sep 8, 2016 by ForumSTM32.ForumSTM3
I've found a bug in the implementation of osMailCAlloc - the code uses sizeof(queue_id->queue_def->item_sz) when item_sz already has the right value.

@@ -1114,11 +1114,11 @@ void *osMailCAlloc (osMailQId queue_id, uint32_t millisec)
 {
   uint32_t i;
   void *p = osMailAlloc(queue_id, millisec);
    
   if (p) {
-    for (i = 0; i < sizeof(queue_id->queue_def->item_sz); i++) {
+    for (i = 0; i < queue_id->queue_def->item_sz; i++) {
       ((uint8_t *)p)[i] = 0;
     }
   }
    
   return p;

I'm using STM32Cube 4.16.0. 

Outcomes