backup/dynamic_index: explicitly zero-initialize the header
The writer.write_all() call accessed data marked as undefined to valgrind. Note that we shouldn't write out uninitialized memory for security reasons anyway. (note that vec::undefined already did zero-initialize the data, but also marked it as undefined for valgrind when compiling with the valgrind feature) Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
990b930f22
commit
d21f8a5b5b
|
@ -423,7 +423,7 @@ impl DynamicIndexWriter {
|
||||||
|
|
||||||
let uuid = Uuid::new_v4();
|
let uuid = Uuid::new_v4();
|
||||||
|
|
||||||
let mut buffer = vec::undefined(header_size);
|
let mut buffer = vec::zeroed(header_size);
|
||||||
let header = crate::tools::map_struct_mut::<DynamicIndexHeader>(&mut buffer)?;
|
let header = crate::tools::map_struct_mut::<DynamicIndexHeader>(&mut buffer)?;
|
||||||
|
|
||||||
header.magic = super::DYNAMIC_SIZED_CHUNK_INDEX_1_0;
|
header.magic = super::DYNAMIC_SIZED_CHUNK_INDEX_1_0;
|
||||||
|
|
Loading…
Reference in New Issue