Wipe buffers to be sure padding is always empty.

Detected by valgrind as writing unitialized data.
This commit is contained in:
Milan Broz
2022-11-27 23:18:36 +01:00
parent 32344d5a84
commit 487e85fdec
2 changed files with 2 additions and 0 deletions

View File

@@ -236,6 +236,7 @@ int LUKS_hdr_backup(const char *backup_file, struct crypt_device *ctx)
r = -ENOMEM;
goto out;
}
memset(buffer, 0, buffer_size);
log_dbg(ctx, "Storing backup of header (%zu bytes) and keyslot area (%zu bytes).",
sizeof(hdr), hdr_size - LUKS_ALIGN_KEYSLOTS);