From cd5b5ebb074be2d9283896e92f6c514ee985b1d6 Mon Sep 17 00:00:00 2001 From: mbuhl Date: Thu, 10 Nov 2022 18:58:02 +0000 Subject: [PATCH] Initialize data before passing it to get_input_data. Strictly speaking this is not necessary as all used bits of the uint32_t are zeroed. ok mlarkin --- usr.sbin/vmd/i8253.c | 4 ++-- usr.sbin/vmd/i8259.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/vmd/i8253.c b/usr.sbin/vmd/i8253.c index 20762c26378..6ece8a331d3 100644 --- a/usr.sbin/vmd/i8253.c +++ b/usr.sbin/vmd/i8253.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i8253.c,v 1.35 2022/09/02 21:33:51 cheloha Exp $ */ +/* $OpenBSD: i8253.c,v 1.36 2022/11/10 18:58:02 mbuhl Exp $ */ /* * Copyright (c) 2016 Mike Larkin * @@ -225,7 +225,7 @@ vcpu_exit_i8253_misc(struct vm_run_params *vrp) uint8_t vcpu_exit_i8253(struct vm_run_params *vrp) { - uint32_t out_data; + uint32_t out_data = 0; uint8_t sel, rw, data; uint64_t ns, ticks; struct timespec now, delta; diff --git a/usr.sbin/vmd/i8259.c b/usr.sbin/vmd/i8259.c index 0b5579dc95c..f7862f5e9d1 100644 --- a/usr.sbin/vmd/i8259.c +++ b/usr.sbin/vmd/i8259.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i8259.c,v 1.20 2021/06/16 16:55:02 dv Exp $ */ +/* $OpenBSD: i8259.c,v 1.21 2022/11/10 18:58:02 mbuhl Exp $ */ /* * Copyright (c) 2016 Mike Larkin * @@ -589,7 +589,7 @@ static void i8259_io_write(struct vm_exit *vei) { uint16_t port = vei->vei.vei_port; - uint32_t data; + uint32_t data = 0; uint8_t n = 0; get_input_data(vei, &data); -- 2.20.1