flatbuffers/tests/rust_usage_test
brianmacy 429c28c783
fix(rust): Zero vtable memory in write_vtable to prevent uninitialized data (#8898)
The write_vtable() function's comment claimed to "fill the WIP vtable
with zeros" but make_space() only reserves memory without initializing
it. When using custom allocators with non-zeroed buffers, unset vtable
field entries would contain garbage instead of zero (which indicates
"use default value").

This fix explicitly zeros the vtable memory after reserving space,
matching the C++ implementation's buf_.fill_big() behavior.

Added regression test using a garbage-filled allocator (0xAA) that
verifies vtable entries for unset fields are properly zeroed.

Fixes #8894
2026-02-04 09:00:44 -05:00
..
benches bulk code format fix (#8707) 2025-09-23 21:50:27 -07:00
bin Improves Rust code generation (#8564) 2025-12-02 18:06:24 -08:00
outdir bulk code format fix (#8707) 2025-09-23 21:50:27 -07:00
tests fix(rust): Zero vtable memory in write_vtable to prevent uninitialized data (#8898) 2026-02-04 09:00:44 -05:00
Cargo.toml Rust fix compilation for no_std targets #2 (#7553) 2022-10-19 09:14:41 -04:00