]> git.sur5r.net Git - openocd/commitdiff
Fix off by one bug in FreeRTOS
authorEvan Hunter <ehunter@broadcom.com>
Fri, 26 Aug 2011 06:30:45 +0000 (16:30 +1000)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Sat, 27 Aug 2011 17:37:22 +0000 (19:37 +0200)
src/rtos/FreeRTOS.c

index 24397ef68838a206b96bd98ac8c536d01b5ed067..10a9b8c0ead47fa5f99924aae8023b74a25685e3 100644 (file)
@@ -233,10 +233,10 @@ static int FreeRTOS_update_threads( struct rtos *rtos )
        retval = target_read_buffer( rtos->target, rtos->symbols[FreeRTOS_VAL_uxTopUsedPriority].address, param->pointer_width, (uint8_t *)&max_used_priority );
 
 
-       symbol_address_t* list_of_lists = (symbol_address_t *)malloc( sizeof( symbol_address_t ) * ( max_used_priority + 5 ) );
+       symbol_address_t* list_of_lists = (symbol_address_t *)malloc( sizeof( symbol_address_t ) * ( max_used_priority+1 + 5 ) );
 
        int num_lists;
-       for( num_lists = 0; num_lists < max_used_priority; num_lists++ )
+       for( num_lists = 0; num_lists <= max_used_priority; num_lists++ )
        {
                list_of_lists[num_lists] =  rtos->symbols[FreeRTOS_VAL_pxReadyTasksLists].address + num_lists * param->list_width;
        }