Closed mavstuff closed 2 years ago
Duplicate of #55.
Hi @mavstuff,
Thank you for your report. This request will be forwarded to our development teams for deeper analysis. We will be back to you as soon as they provide me with their answer.
This duplicated issue will remain closed. The pull-request #55 that you reported will be kept open to track the point.
Thank you for you again for your report.
With regards,
thank you
Describe the set-up The board is STM32F769I-DISCO. The IDE is OpenSTM32. Using CubeMX 5.3.0 with FreeRTOS with FATFS and SD card DMA template. HAL version is 1.16.1.
Describe the bug The bug appears from time-to time as the system falling into Hard Fault for no apparent reason.
In the file stm32f7xx_hal_sd.c there is a function static uint32_t SD_FindSCR(SD_HandleTypeDef hsd, uint32_t pSCR)
which has the followng code:
Please note that *(tempscr + index) may overflow as tempscr is only two elements long and the loop never checks for an array boundary.
Also, there are two more places worth fixing for buffer overrun which use SDMMC_ReadFIFO(hsd->Instance) in the same file. But they are not used in the DMA template.
Pull request created: https://github.com/STMicroelectronics/STM32CubeF7/pull/55