In the current code we leave the argument arrays for the get/set hvcall unitialized, setting only individual fields. some fields will be populated during the hvcall, but in any case the arg arrays will contain unitialized data (e.g. in reserved fields), to which static analysis objects to.
Fixes: c38eb12c85 Signed-off-by: Magnus Kulke <[email protected]> --- target/i386/mshv/msr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/mshv/msr.c b/target/i386/mshv/msr.c index 8c220a9942..a35415ed9d 100644 --- a/target/i386/mshv/msr.c +++ b/target/i386/mshv/msr.c @@ -326,7 +326,7 @@ int mshv_get_msrs(CPUState *cpu) { int ret = 0; size_t n_assocs = MSHV_MSR_TOTAL_COUNT; - struct hv_register_assoc assocs[MSHV_MSR_TOTAL_COUNT]; + struct hv_register_assoc assocs[MSHV_MSR_TOTAL_COUNT] = { 0 }; size_t i, j; uint32_t name; @@ -386,7 +386,7 @@ static void load_from_env(const CPUState *cpu, struct hv_register_assoc *assocs, int mshv_set_msrs(const CPUState *cpu) { size_t n_assocs = MSHV_MSR_TOTAL_COUNT; - struct hv_register_assoc assocs[MSHV_MSR_TOTAL_COUNT]; + struct hv_register_assoc assocs[MSHV_MSR_TOTAL_COUNT] = { 0 }; int ret; size_t i, j; -- 2.34.1
