mirror of
https://github.com/trussed-dev/littlefs2.git
synced 2026-03-11 16:30:52 -07:00
Previously, we reported the lookahead buffer size in bytes but littlefs2-sys expects the lookahead buffer size as a multiple of 8 bytes. This could lead to a buffer overflow causing filesystem corruption. This patch fixes the reported lookahead buffer size. Note that Storage::LOOKAHEAD_WORDS_SIZE allows users to set invalid values (as it is measured in 4 bytes, not in 8 bytes). Invalid values that were previously accepted because of the wrong buffer size calculation can now be rejected by littlefs2-sys. This is a combination of two previous patches: https://github.com/trussed-dev/littlefs2/pull/19 https://github.com/Nitrokey/littlefs2/pull/1 Fixes: https://github.com/trussed-dev/littlefs2/issues/16