ML-dev-crypto opened a new pull request, #19444:
URL: https://github.com/apache/nuttx/pull/19444
## Summary
This fixes a divide-by-zero in `stat()` when a filesystem reports a block
size larger than can be represented by `blksize_t`.
`blksize_t` is currently defined as `int16_t`. For filesystems with block
sizes larger than 32767 bytes (for example, LittleFS on NAND devices using
64 KiB or 128 KiB erase blocks), `st_blksize` may overflow to zero. This
causes an integer divide-by-zero when `st_blocks` is calculated.
## Changes
- Widen `blksize_t` from `int16_t` to `int32_t` in `include/sys/types.h`.
- Update `nuttx_blksize_t` in `include/nuttx/fs/hostfs.h` to keep it
consistent with `blksize_t`.
Fixes #19432
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]