Skip to content

Commit e9031dc

Browse files
committed
fix(es): use PLATFORM bound for pool bucket array size check
The NumBlockSizes validation in CFE_ES_PoolCreateEx_WithAlignment uses CFE_MISSION_ES_POOL_MAX_BUCKETS, but the actual Buckets array in CFE_ES_GenPoolRecord_t is sized to CFE_PLATFORM_ES_POOL_MAX_BUCKETS. When MISSION > PLATFORM (a valid, documented configuration), this allows NumBlockSizes values that overflow the array in GenPoolInitialize, corrupting adjacent entries in the global pool table.
1 parent 0896102 commit e9031dc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎modules/es/fsw/src/cfe_es_mempool.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ CFE_Status_t CFE_ES_PoolCreateEx_WithAlignment(CFE_ES_MemHandle_t *PoolID,
227227
}
228228

229229
/* If too many sizes are specified, return an error */
230-
if (NumBlockSizes > CFE_MISSION_ES_POOL_MAX_BUCKETS)
230+
if (NumBlockSizes > CFE_PLATFORM_ES_POOL_MAX_BUCKETS)
231231
{
232232
CFE_ES_WriteToSysLog("%s: Num Block Sizes (%d) greater than max (%d)\n",
233233
__func__,

0 commit comments

Comments
 (0)