mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-11 22:22:31 +00:00
f0561b7fb0a6f36fc3ddd8cf80019ee475a4f44b
Audit finding 4, and the rest of storytold/wordcraft#3661. - dict.rs: `Dictionary::from_bytes` inflates with `decompress_to_vec_with_limit` (64 MiB; the bundled en-US one is ~1 MB) and caps the words it keeps (bytes and count): front coding lets a 2-byte line spell out a 255-byte word, so the inflated size alone doesn't bound storage. - hunspell.rs: one `read_capped` reader — regular files only, size checked on the open handle and the read itself bounded by `take(MAX_FILE + 1)`, so no TOCTOU between metadata and read and no endless read from a FIFO or device. - tr: the Turkish loader reads through `read_capped` and decodes with `hunspell::decode` (it read both files whole, with no cap at all). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Languages
Rust
99%
Max
0.7%
Python
0.3%