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:
Wolfgang Bumiller 2019-08-23 11:39:53 +02:00
parent 990b930f22
commit d21f8a5b5b
1 changed files with 1 additions and 1 deletions

View File

@ -423,7 +423,7 @@ impl DynamicIndexWriter {
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)?;
header.magic = super::DYNAMIC_SIZED_CHUNK_INDEX_1_0;