Files
wasmtime/crates
Peter Huene 4632228b35 Fix fd_readdir to properly truncate directory entry names.
Previously, `fd_readdir` was truncating directory entry names based on the
calculation of `min(name_len, buf_len - bufused)`, but `bufused` was not being
updated after writing in the `dirent` structure to the buffer.

This allowed `bufused` to be incremented beyond `buf_len` and returned as the
number of bytes written to the buffer, which is invalid.

This fix adjusts `bufused` when the buffer is written to for the `dirent` so
that name truncation happens as expected.

Fixes #2618.
2021-02-01 11:41:12 -08:00
..
2021-01-22 16:02:29 -08:00