git: 38cb3cac475c - stable/12 - mkimg: zero entry in vhdx_write_metadata

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Sun, 28 Nov 2021 02:56:13 UTC
The branch stable/12 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=38cb3cac475c70b7c9e71fb13d48fbdce40f52fd

commit 38cb3cac475c70b7c9e71fb13d48fbdce40f52fd
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2021-11-21 00:29:11 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2021-11-28 02:55:46 +0000

    mkimg: zero entry in vhdx_write_metadata
    
    Otherwise _reserved might contain uninitialized data.
    
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 036af1053acd6cae68c5fb6bed30508f2e40be13)
---
 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);