Skip to content

Commit b3c8f82

Browse files
committed
Fix #2828, 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 b3c8f82

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,12 @@ 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__,
234234
(int)NumBlockSizes,
235-
CFE_MISSION_ES_POOL_MAX_BUCKETS);
235+
CFE_PLATFORM_ES_POOL_MAX_BUCKETS);
236236
return CFE_ES_BAD_ARGUMENT;
237237
}
238238

0 commit comments

Comments
 (0)