Files
tauri-plugins-workspace/plugins
Lucas Fernandes Nogueira 5e6c023a79 fix(fs): cap the buffer allocated by the read command (#3626)
In plugins/fs/src/commands.rs read, `vec![0; len]` used the length sent
by the webview as is, so a huge `len` aborted the process on allocation
failure, and the whole buffer (not only the bytes read) was sent back.

The length is now capped to the rest of the file (at least 64 KiB) for
regular files and to 64 MiB otherwise, the allocation uses try_reserve so a
failure is an error, and the buffer is truncated to the bytes read. The JS
side only ever used the first `nread` bytes. Unit test for the cap.
2026-10-09 12:58:35 -03:00
..
2026-09-26 17:21:49 -03:00
2026-09-30 19:19:08 -03:00
2026-09-30 19:19:08 -03:00
2026-10-07 13:58:40 +02:00
2026-09-29 20:54:59 +02:00
2026-09-26 17:21:49 -03:00
2026-09-26 17:21:49 -03:00
2026-10-07 20:28:15 +02:00
2026-09-26 17:21:49 -03:00
2026-09-26 17:21:49 -03:00