diff options
author | Angus Gratton <angus@redyak.com.au> | 2025-02-18 16:11:13 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-02-26 10:41:51 +1100 |
commit | 731f7adf4f4541a36b32d59087148f78b39d7a27 (patch) | |
tree | 253d527c6dbe0c58f54a431ed8c60937ee8e918b /py/parsenum.c | |
parent | 8ce7a58be21eb77532b109594abcc4e47aa8d887 (diff) | |
download | micropython-731f7adf4f4541a36b32d59087148f78b39d7a27.tar.gz micropython-731f7adf4f4541a36b32d59087148f78b39d7a27.zip |
stm32/sdcard: Fix unchecked uint32_t overflow in SD card driver.
Manifests as `readblocks(-1, buf)` failing. The ST HAL does a bounds
check, but it checks `(block_num + num_blocks)` is within bounds, so if
these values overflow then it allows the read which seems to hang some SD
Cards (but not all).
Fix by explicitly testing for overflow in our layer of the driver.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'py/parsenum.c')
0 files changed, 0 insertions, 0 deletions