You've already forked uutils.github.io
mirror of
https://github.com/uutils/uutils.github.io.git
synced 2026-06-10 16:12:28 -07:00
17e38beade
browser_wasi_shim's Filestat.write_bytes() uses setUint8 for the 1-byte filetype field at offset 16, leaving bytes 17-23 unwritten. Since Rust allocates the stat buffer with MaybeUninit, those padding bytes contain stack garbage that corrupts the struct. Fix by replacing write_bytes with a version that writes filetype as a full 8-byte BigUint64 (zero-extended), clearing the padding. Also add a test asserting file sizes are reasonable.