Question
STM32Cube FreeRTOS Bug
Posted on September 07, 2016 at 18:15
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.0.