this Array is of size LX_NOR_EXTENDED_CACHE_SIZE which is set to 8, but the for loop iterates till lx_nor_flash_extended_cache_entries
the lx_nor_flash_extended_cache_entries value is set in the _lx_nor_flash_extended_cache_enable function, and is basically the number of sector sized chunks from the given ram Cache
If the user gives a cache in the size of more than LX_NOR_EXTENDED_CACHE_SIZE sectors this may lead to exceeding the size of the lx_nor_flash_extended_cache array.
Maybe some sort of input validation should be added to make sure the given ram memory isn't too big?
The function _lx_nor_flash_driver_read has a section that iterates over the
lx_nor_flash_extended_cache
arrayhttps://github.com/azure-rtos/levelx/blob/61f92c00c74ebe8c5798652b756115cc8995b894/common/src/lx_nor_flash_driver_read.c#L107-L155
this Array is of size LX_NOR_EXTENDED_CACHE_SIZE which is set to 8, but the for loop iterates till
lx_nor_flash_extended_cache_entries
the
lx_nor_flash_extended_cache_entries
value is set in the_lx_nor_flash_extended_cache_enable
function, and is basically the number of sector sized chunks from the given ram Cachehttps://github.com/azure-rtos/levelx/blob/61f92c00c74ebe8c5798652b756115cc8995b894/common/src/lx_nor_flash_extended_cache_enable.c#L117-L139
If the user gives a cache in the size of more than
LX_NOR_EXTENDED_CACHE_SIZE
sectors this may lead to exceeding the size of thelx_nor_flash_extended_cache
array.Maybe some sort of input validation should be added to make sure the given ram memory isn't too big?