SDMMC - [STM32CubeL4][1.13.0][stm32l4xx_hal_sd] Invalid pointer address dereferencing
In the file stm32l4_hal_sd.c in functions:
- HAL_SD_WriteBlocks
- HAL_SD_ReadBlocks
No check is performed on tempbuff's bounds: its value must not exceeds pData base address + pData size but tempbuff gets incremented indefinitely until a hardfault is triggered by dereferencing reserved address space.
Fix: enclose the block where tempbuff is incremented with the following condition:
if( (tempbuff - pData) < (NumberOfBlocks * BLOCKSIZE))
