git: 036af1053acd - main - mkimg: zero entry in vhdx_write_metadata

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Sun, 21 Nov 2021 00:38:56 UTC
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=036af1053acd6cae68c5fb6bed30508f2e40be13

commit 036af1053acd6cae68c5fb6bed30508f2e40be13
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2021-11-21 00:29:11 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2021-11-21 00:37:25 +0000

    mkimg: zero entry in vhdx_write_metadata
    
    Otherwise _reserved might contain uninitialized data.
    
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
---
 usr.bin/mkimg/vhdx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/usr.bin/mkimg/vhdx.c b/usr.bin/mkimg/vhdx.c
index 4c97b20f5996..744d6e810ca5 100644
--- a/usr.bin/mkimg/vhdx.c
+++ b/usr.bin/mkimg/vhdx.c
@@ -331,6 +331,7 @@ vhdx_write_metadata(int fd, uint64_t image_size)
 	memset(metadata, 0, SIZE_1MB);
 
 	memset(&header, 0, sizeof(header));
+	memset(&entry, 0, sizeof(entry));
 
 	le64enc(&header.signature, VHDX_METADATA_TABLE_HEADER_SIGNATURE);
 	le16enc(&header.entry_count, 5);