Skip to content

Conversation

alrvid
Copy link
Contributor

@alrvid alrvid commented Jun 30, 2023

Fixes undefined behavior where SDCardBlockDevice::wait_for_completition() runs off the end without returning a value.

alrvid added 5 commits June 30, 2023 17:42
Fixes undefined behavior where SDCardBlockDevice::wait_for_completition() runs off the end without returning a value.
The size of large block devices overflows when these variables are 32 bits long. For example, a 32 GB SD Card is reported as smaller than it really is.
The sd_card_info.sector_count and sd_card_info.sector_size_bytes variables are both 32 bit, so the multiplication overflows for large block devices.
@alrvid
Copy link
Contributor Author

alrvid commented Jun 30, 2023

Also fixes an overflow in the reported size of block devices by changing the data type to 64 bits and by preventing a multiplication overflow.

@facchinm facchinm merged commit 74f57cc into arduino:main Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants